Skip to content

Commit

Permalink
Move available property in BasePassiveBluetoothCoordinator to Passive…
Browse files Browse the repository at this point in the history
…BluetoothDataUpdateCoordinator (home-assistant#117056)
  • Loading branch information
bdraco authored May 8, 2024
1 parent 04c0b7d commit 19c26b7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ def __init__(
super().__init__(hass, logger, address, mode, connectable)
self._listeners: dict[CALLBACK_TYPE, tuple[CALLBACK_TYPE, object | None]] = {}

@property
def available(self) -> bool:
"""Return if device is available."""
return self._available

@callback
def async_update_listeners(self) -> None:
"""Update all registered listeners."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def __init__(
@property
def available(self) -> bool:
"""Return if the device is available."""
return super().available and self.last_update_success
return self._available and self.last_update_success

@callback
def async_get_restore_data(
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/bluetooth/update_coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ def last_seen(self) -> float:
# was set when the unavailable callback was called.
return self._last_unavailable_time

@property
def available(self) -> bool:
"""Return if the device is available."""
return self._available

@callback
def _async_start(self) -> None:
"""Start the callbacks."""
Expand Down

0 comments on commit 19c26b7

Please sign in to comment.