mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Decouple BroadlinkDevice.available property (#58853)
* Decouple BroadlinkDevice.available property * Exclude unreachable line from coverage
This commit is contained in:
parent
be94ce42a5
commit
774e1b0022
@ -56,6 +56,13 @@ class BroadlinkDevice:
|
||||
"""Return the mac address of the device."""
|
||||
return self.config.data[CONF_MAC]
|
||||
|
||||
@property
|
||||
def available(self):
|
||||
"""Return True if the device is available."""
|
||||
if self.update_manager is None: # pragma: no cover
|
||||
return False
|
||||
return self.update_manager.available
|
||||
|
||||
@staticmethod
|
||||
async def async_update(hass, entry):
|
||||
"""Update the device and related entities.
|
||||
|
@ -47,8 +47,8 @@ class BroadlinkEntity(Entity):
|
||||
|
||||
@property
|
||||
def available(self):
|
||||
"""Return True if the remote is available."""
|
||||
return self._device.update_manager.available
|
||||
"""Return True if the entity is available."""
|
||||
return self._device.available
|
||||
|
||||
@property
|
||||
def device_info(self) -> DeviceInfo:
|
||||
|
Loading…
x
Reference in New Issue
Block a user