Skip to content

Commit e431b1a

Browse files
committed
Fix key error in clean func
1 parent 39356e7 commit e431b1a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

custom_components/load_shedding/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
"@wernerhp"
1616
],
1717
"iot_class": "cloud_polling",
18-
"version": "1.0.0"
18+
"version": "1.0.1"
1919
}

custom_components/load_shedding/sensor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,8 @@ def get_sensor_attrs(forecast: list, stage: Stage = Stage.NO_LOAD_SHEDDING) -> d
621621
def clean(data: dict) -> dict:
622622
"""Remove default values from dict"""
623623
for (key, value) in DEFAULT_DATA.items():
624+
if key not in data:
625+
continue
624626
if data[key] == value:
625627
del data[key]
626628

0 commit comments

Comments
 (0)