Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
a056e98
Handle negative energy-pulse values
bouwew Mar 3, 2025
bc58070
Extend logging showing production pulses
bouwew Mar 5, 2025
6e10e93
Add debug-message showing CircleEnergyLog data
bouwew Mar 10, 2025
944e34c
Add MAC to CircleEnergy log-message
bouwew Mar 23, 2025
890bfbc
Add collected_pulses debug-logging
bouwew Mar 13, 2025
0b5c553
Fix typo in logging
bouwew Mar 13, 2025
f4ad4ab
Extend collected_pulses logging
bouwew Mar 14, 2025
2bc498b
Add_log(): support both cons-/prod-type of logs
bouwew Mar 23, 2025
d585a88
Add missing await for energy_log_update()
bouwew Mar 16, 2025
622b5ca
Add missing line in _reset_log_references()
bouwew Mar 17, 2025
e4b109d
Formatting, remove wrong guarding(?)
bouwew Mar 23, 2025
ae33e72
Don't update production_log_refs when not required
bouwew Mar 18, 2025
9dcba83
Formatting
bouwew Mar 23, 2025
9c59cbd
Add guarding for production _energy_statistics
bouwew Mar 23, 2025
29a9252
Don't update production rollover when no production
bouwew Mar 18, 2025
cef0b64
Update _update_rollover() docstring
bouwew Mar 22, 2025
59e76dd
Output production-statistics as positive values
bouwew Mar 23, 2025
dbe9fd8
Bump to a55
bouwew Mar 23, 2025
fe96f99
Change-update _logs_missing logging
bouwew Mar 23, 2025
026d11c
Improve logging, formatting
bouwew Mar 23, 2025
142b7f6
Bump to a56
bouwew Mar 23, 2025
9ead2f5
Pulses_production/_produced are negative
bouwew Mar 23, 2025
06ad566
Bump to a57
bouwew Mar 23, 2025
2a75755
Formatting
bouwew Mar 23, 2025
8d9b4e4
Formatting
bouwew Mar 23, 2025
6ae788e
Set MAX_LOG_HOURS to 24
bouwew Mar 23, 2025
145983c
Bump to a58
bouwew Mar 23, 2025
175dc10
Add idea-text to update_pulse_counter() docstring
bouwew Mar 23, 2025
01a8ec0
update_pulse_counter(): add rollover log-debug-messages
bouwew Mar 24, 2025
4146840
collected_pulses(): don't return None's at rollover
bouwew Mar 24, 2025
f15f11f
Set to a59
bouwew Mar 24, 2025
bac0c4e
Fix related test-assert
bouwew Mar 24, 2025
ce3742a
Fix 2nd related test-assert
bouwew Mar 24, 2025
719b737
Remove commented-out code
bouwew Mar 24, 2025
ad4c29f
Clean up update_pulse_counter() docstring
bouwew Mar 24, 2025
c26857d
Revert back to WEEK_IN_HOURS
bouwew Mar 24, 2025
a6a5351
Bump to a60
bouwew Mar 24, 2025
6b4aa61
_add_log_record(): formatting
bouwew Mar 24, 2025
5803e55
Fix typo in comment
bouwew Mar 24, 2025
d2a6db7
Formatting
bouwew Mar 26, 2025
d9c2afc
Add pulsecounter_reset booleans, and detection
bouwew Mar 26, 2025
a8bfbc0
Add counter_reset guarding for log_pulses reset
bouwew Mar 27, 2025
b5b3e19
Improve
bouwew Mar 27, 2025
6060f5e
Bump to a62
bouwew Mar 27, 2025
ae7f823
Use common _pulsecounter_reset to reset both counters while only one …
bouwew Mar 27, 2025
e6d158e
Bump to a63
bouwew Mar 27, 2025
b08cb08
Set MAX_LOG_HOURS to DAY_IN_HOURS
bouwew Mar 27, 2025
daada32
Remove all week-related EnergyTypes
bouwew Mar 27, 2025
b21e015
Start cleaning week-related test-asserts
bouwew Mar 27, 2025
b2bb99e
Counter.py: clean up imports
bouwew Mar 27, 2025
a24cb79
Don't use gather
bouwew Mar 27, 2025
acbab3c
Bump to a64
bouwew Mar 27, 2025
109c50d
_collect_pulses_from_logs(): add debug-logging
bouwew Mar 28, 2025
474f19d
Fix typo in comment
bouwew Mar 28, 2025
14e6f57
Bump to a65
bouwew Mar 28, 2025
975d8bc
Try to not block the event_loop
bouwew Mar 28, 2025
fff6bc6
Bump to a66
bouwew Mar 28, 2025
4a9b2b3
Revert "Try to not block the event_loop"
bouwew Mar 28, 2025
9e896e4
Try something else
bouwew Mar 28, 2025
5953917
Bump to a67
bouwew Mar 28, 2025
50ef927
Improve _collect_pulses_from_logs()
bouwew Mar 28, 2025
d366bea
Bump to a68
bouwew Mar 28, 2025
e43e97e
Try to avoid using asyncio_sleep()
bouwew Mar 28, 2025
d5278ce
Bump to a69
bouwew Mar 28, 2025
b3fe6f5
Collect last_hourly_reset timestamps
bouwew Mar 30, 2025
10693d4
Line up interval reset with device hourly pulsecounter reset
bouwew Mar 30, 2025
2070561
Adapt hourly reset time, add hourly_reset_time test-assert
bouwew Mar 30, 2025
c3da099
Improve hourly_reset_time property
bouwew Mar 30, 2025
ab83196
Add debug logging
bouwew Mar 30, 2025
607470a
Fix walrus
bouwew Mar 30, 2025
b5403ca
Test: line up 2nd test-time
bouwew Mar 30, 2025
21b162f
Bump to a71
bouwew Mar 30, 2025
18d8d81
Reset log_pulses after pulsecounter resets.
bouwew Mar 30, 2025
6b1ebd0
Revert changes in counter.py
bouwew Mar 30, 2025
057ca9d
Fixes
bouwew Mar 30, 2025
7cac114
Add/improve testing
bouwew Mar 30, 2025
9d468f9
Bump to a72
bouwew Mar 30, 2025
c937c4a
Init new selfs
bouwew Mar 30, 2025
f970d64
Add testcase for midnight rollover
bouwew Mar 31, 2025
d643f77
Remove double resetting of log_pulses
bouwew Mar 31, 2025
b377de1
More debug
bouwew Mar 31, 2025
3002c2c
Party revert removal
bouwew Mar 31, 2025
a7b528a
Add add_log debugging
bouwew Mar 31, 2025
c6b9dd5
Try test
bouwew Mar 31, 2025
208806f
Try update _last_log_consumption_timestamp
bouwew Mar 31, 2025
e832fc7
Try test 2
bouwew Mar 31, 2025
5cda89d
Try test 3
bouwew Apr 1, 2025
8fdf948
More debug
bouwew Apr 1, 2025
8213614
Try test 4
bouwew Apr 1, 2025
7d64bfe
Extend update_pulse-counter logging
bouwew Apr 1, 2025
00f9dfe
Clean up test-code
bouwew Apr 1, 2025
bc3ae98
Reorganize updfate_pulse_counter()
bouwew Apr 1, 2025
9c78ba4
Revert most
bouwew Apr 1, 2025
cb3ae5e
Combine loggers
bouwew Apr 1, 2025
2fd82f7
Clean up test-debugging
bouwew Apr 1, 2025
04247d1
Bump to a73
bouwew Apr 1, 2025
73974be
Pre-commit fixes
bouwew Apr 1, 2025
3b38975
Extend docstring of hourly_reset_time property
bouwew Apr 1, 2025
320b6da
Add comment on log_time_stamp changes
bouwew Apr 1, 2025
d724d34
Shorten log_time_stamp
bouwew Apr 1, 2025
75cf08d
Remove week-related from api
bouwew Apr 2, 2025
9c62ac8
Delay/sync the from_timestamps as well
bouwew Apr 2, 2025
d3ea29d
Bump to a74
bouwew Apr 2, 2025
5a39062
Revert from_timestamp additions, add properties instead
bouwew Apr 2, 2025
23897d5
Sync the daily reset time with the device pulsecounter(s) reset
bouwew Apr 2, 2025
a220308
Fix missing logic
bouwew Apr 2, 2025
b93b778
Fix missing hour-reset
bouwew Apr 2, 2025
56672f5
Bump to a75
bouwew Apr 2, 2025
e37c0cd
Consumption/production last_hourly resets are the same
bouwew Apr 2, 2025
4093be8
Adapt code in counter.py
bouwew Apr 2, 2025
c99400b
Fix missing line
bouwew Apr 2, 2025
9cfcd07
Don't use self, use availble input
bouwew Apr 3, 2025
49a06f1
Revert deletion, improve debug-logging
bouwew Apr 3, 2025
df42a5f
Bump to a76
bouwew Apr 3, 2025
dad3da3
Fix datetime attributes
bouwew Apr 3, 2025
6577149
Bump to a77
bouwew Apr 3, 2025
c10bf4b
Refactor update_rollover()
bouwew Apr 3, 2025
aaa1c73
_detect_rollover(): full coverage by using <=
bouwew Apr 3, 2025
77fb8d3
Test: add log after pulse counter reset timestamp
bouwew Apr 3, 2025
e513141
Improve comment
bouwew Apr 4, 2025
d3253a9
Add working-comments
bouwew Apr 4, 2025
c79a5ab
Remove double occurence
bouwew Apr 4, 2025
9d1acff
Remove last_hourly_reset
bouwew Apr 4, 2025
5b29903
Use the pulse_counter_reset event to update the daily last_reset
bouwew Apr 4, 2025
c7404d3
Improve comment
bouwew Apr 4, 2025
a25f73c
Remove working-comments
bouwew Apr 4, 2025
ee1d2fe
Bump to a78
bouwew Apr 4, 2025
ca83ca2
Use sorted logs to collect log_pulses
bouwew Apr 5, 2025
e81fc18
Update last_reset logic once more
bouwew Apr 5, 2025
3bad8cf
Bump to a79
bouwew Apr 5, 2025
fa8b9ff
Last_reset: handle state after pulse_counter reset returns back to False
bouwew Apr 5, 2025
00c384c
Bump to a80
bouwew Apr 5, 2025
679d021
Improve refactoring of _update_rollover()
bouwew Apr 4, 2025
9ca5773
_update_log_references(): don't sync to pulse-counter reset
bouwew Apr 6, 2025
688a8ad
Correct rollover assert
bouwew Apr 6, 2025
1958ed1
Bump to a81
bouwew Apr 6, 2025
35d51e4
Add missing line
bouwew Apr 6, 2025
53348ba
counter-update: add debug-logging
bouwew Apr 7, 2025
458a378
Bump to a82
bouwew Apr 7, 2025
f96de0d
Improve counter update()
bouwew Apr 7, 2025
5c8db1b
Bump to a83
bouwew Apr 7, 2025
6e9a5df
Add missing @property
bouwew Apr 7, 2025
d702ab2
Bump to a84
bouwew Apr 7, 2025
cf84c6d
Remove hourly-reset related, not used
bouwew Apr 7, 2025
88b008b
Remove related test-assert
bouwew Apr 7, 2025
d1ed252
Revert debug-logging related changes
bouwew Apr 7, 2025
47abbfe
Add extra guarding for setting _midnight_reset_passed to True
bouwew Apr 8, 2025
be03a87
Bump to a85
bouwew Apr 8, 2025
179c972
Clean up
bouwew Apr 8, 2025
ae8266e
Move setting _midnight_reset_passed
bouwew Apr 9, 2025
b50ba2b
Bump to a86
bouwew Apr 9, 2025
6127526
Improve midnight reset delaying code further
bouwew Apr 10, 2025
ca546ca
Bump to a87
bouwew Apr 10, 2025
f5a0a33
Test last_reset.hour before setting hour to 0
bouwew Apr 11, 2025
9b21241
Bump to a88
bouwew Apr 11, 2025
2aa7206
Remove debug-logging for testing
bouwew Apr 12, 2025
7836e01
Bump to a89
bouwew Apr 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions plugwise_usb/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,10 @@ class EnergyStatistics:
hour_consumption_reset: datetime | None = None
day_consumption: float | None = None
day_consumption_reset: datetime | None = None
week_consumption: float | None = None
week_consumption_reset: datetime | None = None
hour_production: float | None = None
hour_production_reset: datetime | None = None
day_production: float | None = None
day_production_reset: datetime | None = None
week_production: float | None = None
week_production_reset: datetime | None = None


class PlugwiseNode(Protocol):
Expand Down
30 changes: 20 additions & 10 deletions plugwise_usb/nodes/circle.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,27 +440,25 @@
self._energy_counters.update()
if self._current_log_address is None:
return None

if self._energy_counters.log_addresses_missing is None:
_LOGGER.debug(
"Start with initial energy request for the last 10 log addresses for node %s.",
self._mac_in_str,
)
total_addresses = 11
log_address = self._current_log_address
log_update_tasks = []
while total_addresses > 0:
log_update_tasks.append(self.energy_log_update(log_address))
await self.energy_log_update(log_address)

Check warning on line 452 in plugwise_usb/nodes/circle.py

View check run for this annotation

Codecov / codecov/patch

plugwise_usb/nodes/circle.py#L452

Added line #L452 was not covered by tests
log_address, _ = calc_log_address(log_address, 1, -4)
total_addresses -= 1

for task in log_update_tasks:
await task

if self._cache_enabled:
await self._energy_log_records_save_to_cache()

return
if self._energy_counters.log_addresses_missing is not None:
_LOGGER.debug("Task created to get missing logs of %s", self._mac_in_str)

_LOGGER.debug("Task created to get missing logs of %s", self._mac_in_str)

Check warning on line 461 in plugwise_usb/nodes/circle.py

View check run for this annotation

Codecov / codecov/patch

plugwise_usb/nodes/circle.py#L461

Added line #L461 was not covered by tests
if (
missing_addresses := self._energy_counters.log_addresses_missing
) is not None:
Expand All @@ -472,8 +470,12 @@
)

missing_addresses = sorted(missing_addresses, reverse=True)
for address in missing_addresses:
await self.energy_log_update(address)
tasks = [

Check warning on line 473 in plugwise_usb/nodes/circle.py

View check run for this annotation

Codecov / codecov/patch

plugwise_usb/nodes/circle.py#L473

Added line #L473 was not covered by tests
create_task(self.energy_log_update(address))
for address in missing_addresses
]
for task in tasks:
await task

Check warning on line 478 in plugwise_usb/nodes/circle.py

View check run for this annotation

Codecov / codecov/patch

plugwise_usb/nodes/circle.py#L477-L478

Added lines #L477 - L478 were not covered by tests

if self._cache_enabled:
await self._energy_log_records_save_to_cache()
Expand All @@ -496,6 +498,7 @@
)
return False

_LOGGER.debug("EnergyLogs data from %s, address=%s", self._mac_in_str, address)
await self._available_update_state(True, response.timestamp)
energy_record_update = False

Expand All @@ -504,7 +507,12 @@
# energy pulses collected during the previous hour of given timestamp
for _slot in range(4, 0, -1):
log_timestamp, log_pulses = response.log_data[_slot]

_LOGGER.debug(
"In slot=%s: pulses=%s, timestamp=%s",
_slot,
log_pulses,
log_timestamp
)
if log_timestamp is None or log_pulses is None:
self._energy_counters.add_empty_log(response.log_address, _slot)
elif await self._energy_log_record_update_state(
Expand All @@ -515,9 +523,11 @@
import_only=True,
):
energy_record_update = True

self._energy_counters.update()
if energy_record_update:
await self.save_cache()

return True

async def _energy_log_records_load_from_cache(self) -> bool:
Expand Down
95 changes: 43 additions & 52 deletions plugwise_usb/nodes/helpers/counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,13 @@
PRODUCTION_HOUR = auto()
CONSUMPTION_DAY = auto()
PRODUCTION_DAY = auto()
CONSUMPTION_WEEK = auto()
PRODUCTION_WEEK = auto()


ENERGY_COUNTERS: Final = (
EnergyType.CONSUMPTION_HOUR,
EnergyType.PRODUCTION_HOUR,
EnergyType.CONSUMPTION_DAY,
EnergyType.PRODUCTION_DAY,
EnergyType.CONSUMPTION_WEEK,
EnergyType.PRODUCTION_WEEK,
)
ENERGY_HOUR_COUNTERS: Final = (
EnergyType.CONSUMPTION_HOUR,
Expand All @@ -41,20 +37,13 @@
EnergyType.CONSUMPTION_DAY,
EnergyType.PRODUCTION_DAY,
)
ENERGY_WEEK_COUNTERS: Final = (
EnergyType.CONSUMPTION_WEEK,
EnergyType.PRODUCTION_WEEK,
)

ENERGY_CONSUMPTION_COUNTERS: Final = (
EnergyType.CONSUMPTION_HOUR,
EnergyType.CONSUMPTION_DAY,
EnergyType.CONSUMPTION_WEEK,
)
ENERGY_PRODUCTION_COUNTERS: Final = (
EnergyType.PRODUCTION_HOUR,
EnergyType.PRODUCTION_DAY,
EnergyType.PRODUCTION_WEEK,
)

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -105,11 +94,8 @@
self, pulses_consumed: int, pulses_produced: int, timestamp: datetime
) -> None:
"""Add pulse statistics."""
_LOGGER.debug(
"add_pulse_stats | consumed=%s, for %s",
str(pulses_consumed),
self._mac,
)
_LOGGER.debug("add_pulse_stats for %s with timestamp=%s", self._mac, timestamp)
_LOGGER.debug("consumed=%s | produced=%s", pulses_consumed, pulses_produced)
self._pulse_collection.update_pulse_counter(
pulses_consumed, pulses_produced, timestamp
)
Expand Down Expand Up @@ -160,9 +146,6 @@
self._energy_statistics.log_interval_consumption = (
self._pulse_collection.log_interval_consumption
)
self._energy_statistics.log_interval_production = (
self._pulse_collection.log_interval_production
)
(
self._energy_statistics.hour_consumption,
self._energy_statistics.hour_consumption_reset,
Expand All @@ -171,23 +154,18 @@
self._energy_statistics.day_consumption,
self._energy_statistics.day_consumption_reset,
) = self._counters[EnergyType.CONSUMPTION_DAY].update(self._pulse_collection)
(
self._energy_statistics.week_consumption,
self._energy_statistics.week_consumption_reset,
) = self._counters[EnergyType.CONSUMPTION_WEEK].update(self._pulse_collection)

(
self._energy_statistics.hour_production,
self._energy_statistics.hour_production_reset,
) = self._counters[EnergyType.PRODUCTION_HOUR].update(self._pulse_collection)
(
self._energy_statistics.day_production,
self._energy_statistics.day_production_reset,
) = self._counters[EnergyType.PRODUCTION_DAY].update(self._pulse_collection)
(
self._energy_statistics.week_production,
self._energy_statistics.week_production_reset,
) = self._counters[EnergyType.PRODUCTION_WEEK].update(self._pulse_collection)
if self._pulse_collection.production_logging:
self._energy_statistics.log_interval_production = (

Check warning on line 158 in plugwise_usb/nodes/helpers/counter.py

View check run for this annotation

Codecov / codecov/patch

plugwise_usb/nodes/helpers/counter.py#L158

Added line #L158 was not covered by tests
self._pulse_collection.log_interval_production
)
(

Check warning on line 161 in plugwise_usb/nodes/helpers/counter.py

View check run for this annotation

Codecov / codecov/patch

plugwise_usb/nodes/helpers/counter.py#L161

Added line #L161 was not covered by tests
self._energy_statistics.hour_production,
self._energy_statistics.hour_production_reset,
) = self._counters[EnergyType.PRODUCTION_HOUR].update(self._pulse_collection)
(

Check warning on line 165 in plugwise_usb/nodes/helpers/counter.py

View check run for this annotation

Codecov / codecov/patch

plugwise_usb/nodes/helpers/counter.py#L165

Added line #L165 was not covered by tests
self._energy_statistics.day_production,
self._energy_statistics.day_production_reset,
) = self._counters[EnergyType.PRODUCTION_DAY].update(self._pulse_collection)

@property
def timestamp(self) -> datetime | None:
Expand All @@ -211,14 +189,13 @@
) -> None:
"""Initialize energy counter based on energy id."""
self._mac = mac
self._midnight_reset_passed = False
if energy_id not in ENERGY_COUNTERS:
raise EnergyError(f"Invalid energy id '{energy_id}' for Energy counter")
self._calibration: EnergyCalibration | None = None
self._duration = "hour"
if energy_id in ENERGY_DAY_COUNTERS:
self._duration = "day"
elif energy_id in ENERGY_WEEK_COUNTERS:
self._duration = "week"
self._energy_id: EnergyType = energy_id
self._is_consumption = True
self._direction = "consumption"
Expand Down Expand Up @@ -259,9 +236,16 @@
"""Total energy (in kWh) since last reset."""
if self._pulses is None or self._calibration is None:
return None

if self._pulses == 0:
return 0.0
pulses_per_s = self._pulses / float(HOUR_IN_SECONDS)

# Handle both positive and negative pulses values
negative = False
if self._pulses < 0:
negative = True

Check warning on line 246 in plugwise_usb/nodes/helpers/counter.py

View check run for this annotation

Codecov / codecov/patch

plugwise_usb/nodes/helpers/counter.py#L246

Added line #L246 was not covered by tests

pulses_per_s = abs(self._pulses) / float(HOUR_IN_SECONDS)
corrected_pulses = HOUR_IN_SECONDS * (
(
(
Expand All @@ -276,8 +260,9 @@
+ self._calibration.off_tot
)
calc_value = corrected_pulses / PULSES_PER_KW_SECOND / HOUR_IN_SECONDS
# Guard for minor negative miscalculations
calc_value = max(calc_value, 0.0)
if negative:
calc_value = -calc_value

Check warning on line 264 in plugwise_usb/nodes/helpers/counter.py

View check run for this annotation

Codecov / codecov/patch

plugwise_usb/nodes/helpers/counter.py#L264

Added line #L264 was not covered by tests

return calc_value

@property
Expand All @@ -297,16 +282,21 @@
last_reset = datetime.now(tz=LOCAL_TIMEZONE)
if self._energy_id in ENERGY_HOUR_COUNTERS:
last_reset = last_reset.replace(minute=0, second=0, microsecond=0)
elif self._energy_id in ENERGY_DAY_COUNTERS:
last_reset = last_reset.replace(hour=0, minute=0, second=0, microsecond=0)
elif self._energy_id in ENERGY_WEEK_COUNTERS:
last_reset = last_reset - timedelta(days=last_reset.weekday())
last_reset = last_reset.replace(
hour=0,
minute=0,
second=0,
microsecond=0,
)
if self._energy_id in ENERGY_DAY_COUNTERS:
# Postpone the last_reset time-changes at day-end until a device pulsecounter resets
if last_reset.hour == 0 and (
not pulse_collection.pulse_counter_reset
and not self._midnight_reset_passed
):
last_reset = (last_reset - timedelta(days=1)).replace(

Check warning on line 291 in plugwise_usb/nodes/helpers/counter.py

View check run for this annotation

Codecov / codecov/patch

plugwise_usb/nodes/helpers/counter.py#L291

Added line #L291 was not covered by tests
hour=0, minute=0, second=0, microsecond=0
)
else:
if last_reset.hour == 0 and pulse_collection.pulse_counter_reset:
self._midnight_reset_passed = True

Check warning on line 296 in plugwise_usb/nodes/helpers/counter.py

View check run for this annotation

Codecov / codecov/patch

plugwise_usb/nodes/helpers/counter.py#L296

Added line #L296 was not covered by tests
if last_reset.hour == 1 and self._midnight_reset_passed:
self._midnight_reset_passed = False

Check warning on line 298 in plugwise_usb/nodes/helpers/counter.py

View check run for this annotation

Codecov / codecov/patch

plugwise_usb/nodes/helpers/counter.py#L298

Added line #L298 was not covered by tests
last_reset = last_reset.replace(hour=0, minute=0, second=0, microsecond=0)

pulses, last_update = pulse_collection.collected_pulses(
last_reset, self._is_consumption
Expand All @@ -324,5 +314,6 @@
self._pulses = pulses

energy = self.energy
_LOGGER.debug("energy=%s or last_update=%s", energy, last_update)
_LOGGER.debug("energy=%s on last_update=%s", energy, last_update)
return (energy, last_reset)

Loading
Loading