Skip to content

Commit

Permalink
Adding default as a constant in AdminClientSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
thdfw committed Jan 4, 2025
1 parent b559c17 commit 7a8cf4b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gw_spaceheat/admin/watch/relay_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from admin.watch.widgets.relay_toggle_button import RelayToggleButton
from admin.watch.widgets.timer import TimerDigits
from admin.settings import AdminClientSettings
from actors.config import AdminLinkSettings

__version__: str = "0.2.3"

Expand Down Expand Up @@ -114,10 +115,10 @@ def on_keep_alive_button_pressed(self, _: KeepAliveButton.Pressed):
if _.timeout_seconds is not None:
self.notify(f"Keeping admin alive for {int(_.timeout_seconds/60)} minutes")
else:
self.notify(f"Keeping admin alive for default timeout ({int(AdminClientSettings().default_timeout_seconds/60)} min)")
self.notify(f"Keeping admin alive for maximum timeout ({int(AdminLinkSettings().max_timeout_seconds/60)} min)")
self._relay_client.send_keepalive(_.timeout_seconds)
timer_display = self.app.query_one(TimerDigits)
timer_display.restart(AdminClientSettings().default_timeout_seconds)
timer_display.restart(AdminLinkSettings().max_timeout_seconds)

def on_release_control_button_pressed(self, _: ReleaseControlButton.Pressed):
self._relay_client.send_release_control()
Expand Down

0 comments on commit 7a8cf4b

Please sign in to comment.