mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +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 the mac address of the device."""
|
||||||
return self.config.data[CONF_MAC]
|
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
|
@staticmethod
|
||||||
async def async_update(hass, entry):
|
async def async_update(hass, entry):
|
||||||
"""Update the device and related entities.
|
"""Update the device and related entities.
|
||||||
|
@ -47,8 +47,8 @@ class BroadlinkEntity(Entity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def available(self):
|
def available(self):
|
||||||
"""Return True if the remote is available."""
|
"""Return True if the entity is available."""
|
||||||
return self._device.update_manager.available
|
return self._device.available
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_info(self) -> DeviceInfo:
|
def device_info(self) -> DeviceInfo:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user