private void UpdateAsset() { if (DeviceInstance.Connected) { IAsset asset = null; switch ((DeviceTypes)deviceTypes.SelectedIndex) { case DeviceTypes.BacNet: asset = new BacNetAsset { DeviceId = cmbDeviceId.Text, GatewayId = cmbGatewayId.Text, ObjectType = cmbObjectType.Text, Instance = cmbInstance.Text, Value = trackBarTemperature.Value, Variation = checkBoxVariation.Checked }; break; case DeviceTypes.SBPresence: asset = new PresenceSensorAsset { DeviceId = deviceId.Text, SensorId = sensorId.Text, Mode = (PresenceSensorMode)presence.SelectedValue }; break; } DeviceInstance.UpdateAsset(asset); } }
public PresenceD2HMessage(PresenceSensorAsset asset) { this.DeviceId = asset.DeviceId; this.SensorId = asset.SensorId; this.Presence = asset.CurrentPresence ? 1 : 0; }