Skip to content

Commit

Permalink
Small comments/naming convention updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kingsleyadam committed Oct 18, 2024
1 parent f1d8557 commit ddce49e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/abbfreeathome/devices/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(
self._room_name = room_name
self._callbacks = set()

# Set the initial state of the switch based on output
# Set the initial state of the device based on output
self._refresh_state_from_outputs()

@property
Expand Down Expand Up @@ -117,7 +117,7 @@ def update_device(self, datapoint_key: str, datapoint_value: str):
callback()

def register_callback(self, callback: Callable[[], None]) -> None:
"""Register callback, called when switch changes state."""
"""Register callback, called when device changes state."""
self._callbacks.add(callback)

def remove_callback(self, callback: Callable[[], None]) -> None:
Expand All @@ -127,15 +127,13 @@ def remove_callback(self, callback: Callable[[], None]) -> None:
async def refresh_state(self):
"""Refresh the state of the device from the api."""
for _pairing in self._state_refresh_output_pairings:
_switch_output_id, _switch_output_value = self.get_output_by_pairing(
pairing=_pairing
)
_output_id, _output_value = self.get_output_by_pairing(pairing=_pairing)

_datapoint = (
await self._api.get_datapoint(
device_id=self.device_id,
channel_id=self.channel_id,
datapoint=_switch_output_id,
datapoint=_output_id,
)
)[0]

Expand Down

0 comments on commit ddce49e

Please sign in to comment.