コード例 #1
0
        private async Task CompleteUpdate()
        {
            var currentDeviceModel = deviceSetupService.CurrentDeviceModel;

            if (currentDeviceModel == null)
            {
                return;
            }

            var updateTagsModel = new DevicesUpdateTagsModel
            {
                DeviceIds = new List <Guid> {
                    currentDeviceModel.DeviceId
                },
                Name        = currentDeviceModel.Name,
                Enabled     = currentDeviceModel.Enabled,
                Geolocation = currentDeviceModel.Geolocation,
                Location1   = currentDeviceModel.Location1,
                Location2   = currentDeviceModel.Location2,
                Location3   = currentDeviceModel.Location3,
                SSID        = deviceSetupService.CurrentDeviceModel.SSID
            };

            var success = await deviceRestService.UpdateDevice(updateTagsModel);

            deviceSetupService.IsNew = false;

            OnDeviceUpdated?.Invoke(this, success);
        }
コード例 #2
0
ファイル: ZWayDevice.cs プロジェクト: niklasise/DeafX.Richter
        internal bool UpdateMetrics(ZWayMetrics metrics)
        {
            // If metrics are equal, just return
            if (this.metrics.Equals(metrics))
            {
                return(false);
            }

            this.metrics = metrics;

            OnDeviceUpdated?.Invoke(this);

            return(true);
        }