protected override async Task OnInitializedAsync() { ThingPaginationFilter paginationFilter = new ThingPaginationFilter(); paginationFilter.Type = ThingType.EnergyMonitor; var result = await IoTSuiteService.GetThings(paginationFilter); things = result.Data; thingsPlaceholder = "Choose a Thing"; await InvokeAsync(StateHasChanged); hubConnection = new HubConnectionBuilder() .WithUrl(UriHelper.ToAbsoluteUri("/Hub/SignalR"), options => { options.AccessTokenProvider = async() => { var tokenResult = await TokenProvider.RequestAccessToken(); if (tokenResult.TryGetToken(out var token)) { return(await Task.FromResult(token.Value)); } else { return(await Task.FromResult(string.Empty)); } };
protected async Task FormSubmit(Position args) { try { await IoTSuiteService.UpdatePosition(args); DialogService.Close(args); } catch { NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update Position"); } }
protected async Task FormSubmit(PowerMeterInstantaneous args) { try { await IoTSuiteService.UpdatePowerMeter(args); DialogService.Close(args); } catch { NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update PowerMeter"); } }
protected override async Task OnInitializedAsync() { data = (await IoTSuiteService.GetPosition(Id)).Data; }
protected override async Task OnInitializedAsync() { powerMeterInstantaneous = (await IoTSuiteService.GetPowerMeter(Id)).Data; }