Add 'auto mode' button to the air alarm ui (#17874)

Signed-off-by: c4llv07e <kseandi@gmail.com>
This commit is contained in:
c4llv07e
2023-07-09 22:22:41 +03:00
committed by GitHub
parent 9723126de5
commit 6e66866567
7 changed files with 54 additions and 8 deletions

View File

@@ -33,6 +33,7 @@ public sealed class AirAlarmBoundUserInterface : BoundUserInterface
_window.AtmosDeviceDataChanged += OnDeviceDataChanged;
_window.AtmosAlarmThresholdChanged += OnThresholdChanged;
_window.AirAlarmModeChanged += OnAirAlarmModeChanged;
_window.AutoModeChanged += OnAutoModeChanged;
_window.ResyncAllRequested += ResyncAllDevices;
_window.AirAlarmTabChange += OnTabChanged;
}
@@ -52,6 +53,11 @@ public sealed class AirAlarmBoundUserInterface : BoundUserInterface
SendMessage(new AirAlarmUpdateAlarmModeMessage(mode));
}
private void OnAutoModeChanged(bool enabled)
{
SendMessage(new AirAlarmUpdateAutoModeMessage(enabled));
}
private void OnThresholdChanged(string address, AtmosMonitorThresholdType type, AtmosAlarmThreshold threshold, Gas? gas = null)
{
SendMessage(new AirAlarmUpdateAlarmThresholdMessage(address, type, threshold, gas));