From ffb1d60575345150a4d14cd36b478f66022f993e Mon Sep 17 00:00:00 2001 From: Mathieu Broillet Date: Mon, 1 Jan 2024 16:19:13 +0100 Subject: [PATCH] fix entity not available when offline --- custom_components/easy_computer_manager/switch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/easy_computer_manager/switch.py b/custom_components/easy_computer_manager/switch.py index 7525ddc..36c6199 100644 --- a/custom_components/easy_computer_manager/switch.py +++ b/custom_components/easy_computer_manager/switch.py @@ -151,7 +151,8 @@ class ComputerSwitch(SwitchEntity): name=self._attr_name, manufacturer="Generic", 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)}, )