mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 21:25:13 +02:00
Decouple BroadlinkDevice.available property (#58853)
* Decouple BroadlinkDevice.available property * Exclude unreachable line from coverage
This commit is contained in:
committed by
GitHub
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:
|
||||
|
Reference in New Issue
Block a user