Skip to content

Commit

Permalink
Simplify the night rate sensor logic
Browse files Browse the repository at this point in the history
  • Loading branch information
codyc1515 committed Oct 6, 2024
1 parent 2e0609b commit 514f3ee
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions custom_components/meridian_energy/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,8 @@ def update(self):
else:
# Night rate channel
if (
rounded_date.time()
>= datetime.strptime("21:00", "%H:%M").time()
or rounded_date.time()
< datetime.strptime("07:00", "%H:%M").time()
start_date.hour >= 21 or
start_date.hour <= 6
):
nightRunningSum = nightRunningSum + float(
unit_quantity_active_energy_volume
Expand Down

0 comments on commit 514f3ee

Please sign in to comment.