public void UpdateCurrentAction() { var newCurrentAction = CurrentStateGenerator.Generate(BinarySwitch.Power, PowerSensor.Value); if (newCurrentAction != CurrentAction) { CurrentAction = newCurrentAction; var @event = DeviceEvent.CurrentActionChanged(this, null); AddEvent(@event); } }