Skip to content

Commit

Permalink
fix(sensor): Fixed issue with rates update
Browse files Browse the repository at this point in the history
  • Loading branch information
BottlecapDave committed Nov 4, 2022
1 parent 1050fd4 commit a2fead5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/octopus_energy/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def state(self):

current_rate = None
if self.coordinator.data != None:
rate = self.coordinator.data[(self._mpan, self._is_smart_meter)]
rate = self.coordinator.data[self._mpan]
if rate != None:
for period in rate:
if now >= period["valid_from"] and now <= period["valid_to"]:
Expand Down Expand Up @@ -323,7 +323,7 @@ def state(self):

previous_rate = None
if self.coordinator.data != None:
rate = self.coordinator.data[(self._mpan, self._is_smart_meter)]
rate = self.coordinator.data[self._mpan]
if rate != None:
for period in rate:
if target >= period["valid_from"] and target <= period["valid_to"]:
Expand Down

0 comments on commit a2fead5

Please sign in to comment.