Skip to content

Commit 16c6db3

Browse files
committed
Start adding _current_log_address reset
1 parent 360d566 commit 16c6db3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

plugwise_usb/network/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from ..connection import StickController
1515
from ..constants import ENERGY_NODE_TYPES, UTF8
1616
from ..exceptions import CacheError, MessageError, NodeError, StickError, StickTimeout
17+
from ..nodes.circle import PlugwiseCircle
1718
from ..nodes.helpers.cache import NodeCache
1819
from ..nodes.helpers.pulses import PulseCollection
1920
from ..helpers.util import validate_mac
@@ -571,10 +572,14 @@ async def energy_reset_request(self, mac: str) -> None:
571572
node_cache.update_state(CACHE_ENERGY_COLLECTION, "")
572573
await node_cache.save_cache()
573574

574-
# Clear PulseCollection._logs
575+
# Reset the PulseCollection
575576
pulse_collection = PulseCollection(mac)
576577
pulse_collection.reset()
577578

579+
# Clear PlugwiseCircle._current_log_address
580+
circle = PlugwiseCircle(mac, address(?))
581+
circle._current_log_address = 0
582+
578583
async def set_energy_intervals(
579584
self, mac: str, consumption: int, production: int
580585
) -> None:

0 commit comments

Comments
 (0)