mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 02:37:08 +00:00
Move available property in BasePassiveBluetoothCoordinator to PassiveBluetoothDataUpdateCoordinator (#117056)
This commit is contained in:
parent
04c0b7d3df
commit
19c26b79af
@ -48,6 +48,11 @@ class PassiveBluetoothDataUpdateCoordinator(
|
|||||||
super().__init__(hass, logger, address, mode, connectable)
|
super().__init__(hass, logger, address, mode, connectable)
|
||||||
self._listeners: dict[CALLBACK_TYPE, tuple[CALLBACK_TYPE, object | None]] = {}
|
self._listeners: dict[CALLBACK_TYPE, tuple[CALLBACK_TYPE, object | None]] = {}
|
||||||
|
|
||||||
|
@property
|
||||||
|
def available(self) -> bool:
|
||||||
|
"""Return if device is available."""
|
||||||
|
return self._available
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_update_listeners(self) -> None:
|
def async_update_listeners(self) -> None:
|
||||||
"""Update all registered listeners."""
|
"""Update all registered listeners."""
|
||||||
|
@ -311,7 +311,7 @@ class PassiveBluetoothProcessorCoordinator(
|
|||||||
@property
|
@property
|
||||||
def available(self) -> bool:
|
def available(self) -> bool:
|
||||||
"""Return if the device is available."""
|
"""Return if the device is available."""
|
||||||
return super().available and self.last_update_success
|
return self._available and self.last_update_success
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_get_restore_data(
|
def async_get_restore_data(
|
||||||
|
@ -83,11 +83,6 @@ class BasePassiveBluetoothCoordinator(ABC):
|
|||||||
# was set when the unavailable callback was called.
|
# was set when the unavailable callback was called.
|
||||||
return self._last_unavailable_time
|
return self._last_unavailable_time
|
||||||
|
|
||||||
@property
|
|
||||||
def available(self) -> bool:
|
|
||||||
"""Return if the device is available."""
|
|
||||||
return self._available
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def _async_start(self) -> None:
|
def _async_start(self) -> None:
|
||||||
"""Start the callbacks."""
|
"""Start the callbacks."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user