fix entity not available when offline
This commit is contained in:
parent
7ced302e12
commit
ffb1d60575
@ -151,7 +151,8 @@ class ComputerSwitch(SwitchEntity):
|
|||||||
name=self._attr_name,
|
name=self._attr_name,
|
||||||
manufacturer="Generic",
|
manufacturer="Generic",
|
||||||
model="Computer",
|
model="Computer",
|
||||||
sw_version=utils.get_operating_system_version(self._connection),
|
sw_version=utils.get_operating_system_version(
|
||||||
|
self._connection) if self._connection.is_connected() else "Unknown",
|
||||||
connections={(dr.CONNECTION_NETWORK_MAC, self._mac_address)},
|
connections={(dr.CONNECTION_NETWORK_MAC, self._mac_address)},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user