Skip to content

Commit e5f0d33

Browse files
committed
Prevent error if value is None
File "/config/custom_components/luxtronik2/common.py", line 81, in correct_key_value value = value.replace(" ", "_").replace("/", "_").lower() ^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'replace'
1 parent c5b7167 commit e5f0d33

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

custom_components/luxtronik/common.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ def correct_key_value(
7272
sensor_id: str | LP | LC | LV,
7373
) -> Any:
7474
"""Handle special value corrections."""
75+
# prevent dealing with None value below
76+
if value is None:
77+
return value
7578
# fix 'states may not contain spaces ea for valid translations'
7679
if sensor_id in [
7780
LC.C0080_STATUS,

0 commit comments

Comments
 (0)