Skip to content

Commit

Permalink
Use override mechanism to disable Properties support
Browse files Browse the repository at this point in the history
Instead of disable loading of Supervised entirly override initialization
to prevent loading the Properties interface.
  • Loading branch information
agners committed Aug 20, 2024
1 parent 1e3c491 commit c05f49c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 2 additions & 4 deletions supervisor/dbus/agent/boards/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,8 @@ async def connect(self, bus: MessageBus) -> None:
self._board_proxy = Yellow()
elif self.board == BOARD_NAME_GREEN:
self._board_proxy = Green()
# Currently unused, avoid initialization due to a bug in introspection:
# See: https://github.com/home-assistant/os-agent/issues/206
# elif self.board == BOARD_NAME_SUPERVISED:
# self._board_proxy = Supervised()
elif self.board == BOARD_NAME_SUPERVISED:
self._board_proxy = Supervised()
else:
return

Expand Down
12 changes: 12 additions & 0 deletions supervisor/dbus/agent/boards/supervised.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
"""Supervised board management."""

from typing import Any

from supervisor.dbus.utils import dbus_connected

from .const import BOARD_NAME_SUPERVISED
from .interface import BoardProxy

Expand All @@ -11,3 +15,11 @@ def __init__(self) -> None:
"""Initialize properties."""
super().__init__(BOARD_NAME_SUPERVISED)
self.sync_properties: bool = False

@dbus_connected
async def update(self, changed: dict[str, Any] | None = None) -> None:
"""Do nothing as there are no properties.
Currently unused, avoid using the Properties interface to avoid a bug in
Go D-Bus, see: https://github.com/home-assistant/os-agent/issues/206
"""

0 comments on commit c05f49c

Please sign in to comment.