Skip to content

Commit b5e1dd7

Browse files
committed
Temporary workaround to provide an always-online status for DT [164, 165, 166, 167, 168]
1 parent eff06e8 commit b5e1dd7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

inelsmqtt/devices/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def __init__(
5151
fragments = state_topic.split("/")
5252

5353
self.__mqtt = mqtt
54+
self.__device_class = fragments[TOPIC_FRAGMENTS[FRAGMENT_DEVICE_TYPE]]
5455
self.__device_type = DEVICE_TYPE_DICT[
5556
fragments[TOPIC_FRAGMENTS[FRAGMENT_DEVICE_TYPE]]
5657
]
@@ -148,7 +149,11 @@ def is_available(self) -> bool:
148149
if isinstance(val, (bytes, bytearray)):
149150
val = val.decode()
150151

151-
return DEVICE_CONNECTED.get(val) and self.__values is not None and self.__values._DeviceValue__ha_value is not None
152+
# Temporary workaround to provide an always-online status for DT [164, 165, 166, 167, 168]
153+
if self.__device_class in ["164", "165", "166", "167", "168"]:
154+
return self.__values is not None and self.__values._DeviceValue__ha_value is not None
155+
else:
156+
return DEVICE_CONNECTED.get(val) and self.__values is not None and self.__values._DeviceValue__ha_value is not None
152157

153158
@property
154159
def set_topic(self) -> str:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
55
name="elkoep-mqtt",
6-
version="0.2.29",
6+
version="0.2.30",
77
url="https://github.com/epdevlab/elkoep-mqtt",
88
license="MIT",
99
author="Elko EP s.r.o.",

0 commit comments

Comments
 (0)