Remove client state from server AirAlarmComponent (#31236)

* Remove client state from server AirAlarmComponent

Send information for all connected devices, not just the ones for the
current tab, as attempting to limit this breaks multiple users viewing
the same UI.

Fixes #12842

* Send device data as a list, rather than a dictionary

---------

Co-authored-by: Eoin Mcloughlin <helloworld@eoinrul.es>
This commit is contained in:
eoineoineoin
2024-08-25 03:01:46 +01:00
committed by GitHub
parent a1ab4a3dcd
commit b0375f115c
5 changed files with 17 additions and 75 deletions

View File

@@ -23,7 +23,6 @@ public sealed partial class AirAlarmWindow : FancyWindow
public event Action<AirAlarmMode>? AirAlarmModeChanged;
public event Action<bool>? AutoModeChanged;
public event Action? ResyncAllRequested;
public event Action<AirAlarmTab>? AirAlarmTabChange;
private RichTextLabel _address => CDeviceAddress;
private RichTextLabel _deviceTotal => CDeviceTotal;
@@ -80,11 +79,6 @@ public sealed partial class AirAlarmWindow : FancyWindow
_tabContainer.SetTabTitle(1, Loc.GetString("air-alarm-ui-window-tab-scrubbers"));
_tabContainer.SetTabTitle(2, Loc.GetString("air-alarm-ui-window-tab-sensors"));
_tabContainer.OnTabChanged += idx =>
{
AirAlarmTabChange!((AirAlarmTab) idx);
};
_resyncDevices.OnPressed += _ =>
{
_ventDevices.RemoveAllChildren();
@@ -117,8 +111,6 @@ public sealed partial class AirAlarmWindow : FancyWindow
{
UpdateDeviceData(addr, dev);
}
_tabContainer.CurrentTab = (int) state.Tab;
}
public void UpdateModeSelector(AirAlarmMode mode)