fix entity not available when offline
Some checks failed
Validate with hassfest / validate (push) Failing after 1s
HACS Action / HACS Action (push) Failing after 3s

This commit is contained in:
Mathieu Broillet 2024-01-01 16:24:00 +01:00
parent ffb1d60575
commit 95bd521d06
Signed by: mathieu
GPG Key ID: C0E9E0E95AF03319

View File

@ -152,7 +152,7 @@ class ComputerSwitch(SwitchEntity):
manufacturer="Generic", manufacturer="Generic",
model="Computer", model="Computer",
sw_version=utils.get_operating_system_version( sw_version=utils.get_operating_system_version(
self._connection) if self._connection.is_connected() else "Unknown", self._connection) if self._state else "Unknown",
connections={(dr.CONNECTION_NETWORK_MAC, self._mac_address)}, connections={(dr.CONNECTION_NETWORK_MAC, self._mac_address)},
) )