From 2dd1709eaaee7786704f73c58726173cfb62a625 Mon Sep 17 00:00:00 2001 From: Elad Bar Date: Thu, 13 Oct 2022 14:10:09 +0300 Subject: [PATCH] Fix binary sensor of interface status --- CHANGELOG.md | 1 + custom_components/edgeos/component/managers/home_assistant.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4609bb..5757946 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 2.0.7 - Add service data validation +- Fix binary sensor of interface status ## 2.0.6 diff --git a/custom_components/edgeos/component/managers/home_assistant.py b/custom_components/edgeos/component/managers/home_assistant.py index 0fe06ba..20e5845 100644 --- a/custom_components/edgeos/component/managers/home_assistant.py +++ b/custom_components/edgeos/component/managers/home_assistant.py @@ -1268,7 +1268,7 @@ def _load_interface_status_binary_sensor(self, interface: EdgeOSInterfaceData): entity_name = f"{interface_name} Status" try: - state = interface.up + state = STATE_ON if interface.up else STATE_OFF attributes = { ATTR_FRIENDLY_NAME: entity_name,