We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 702af00 commit 991743eCopy full SHA for 991743e
plugwise_usb/nodes/circle.py
@@ -468,7 +468,8 @@ async def _get_initial_energy_logs(self) -> None:
468
469
# When only consumption is measured, 1 address contains data from 4 hours
470
# When both consumption and production are measured, 1 address contains data from 2 hours
471
- factor = 4 if self.energy_production_interval is None else 2
+ cons_only = self.energy_production_interval is None
472
+ factor = 4 if cons_only else 2
473
max_addresses_to_collect = MAX_LOG_HOURS // factor
474
total_addresses = min(
475
max_addresses_to_collect, ceil(datetime.now(tz=UTC).hour / factor) + 1
0 commit comments