Skip to content

Commit

Permalink
Update sensor.py
Browse files Browse the repository at this point in the history
Fix issue #87 when there is no planned load shedding.
  • Loading branch information
wernerhp authored Dec 31, 2023
1 parent b534366 commit 966fa6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/load_shedding/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def native_value(self) -> StateType:

planned = self.data.get(ATTR_PLANNED, [])
if not planned:
return self._attr_native_value
return Stage.NO_LOAD_SHEDDING

stage = planned[0].get(ATTR_STAGE, Stage.UNKNOWN)
if stage in [Stage.UNKNOWN]:
Expand Down

0 comments on commit 966fa6a

Please sign in to comment.