Move available property in BasePassiveBluetoothCoordinator to PassiveBluetoothDataUpdateCoordinator (#117056)

This commit is contained in:
J. Nick Koston 2024-05-08 17:45:57 -05:00 committed by GitHub
parent 04c0b7d3df
commit 19c26b79af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View file

@ -48,6 +48,11 @@ class PassiveBluetoothDataUpdateCoordinator(
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."""

View file

@ -311,7 +311,7 @@ class PassiveBluetoothProcessorCoordinator(
@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(

View file

@ -83,11 +83,6 @@ class BasePassiveBluetoothCoordinator(ABC):
# 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."""