Skip to content

Commit dc5f4a9

Browse files
committed
Start adding _current_log_address reset
1 parent 5230949 commit dc5f4a9

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
@@ -551,10 +552,14 @@ async def energy_reset_request(self, mac: str) -> None:
551552
node_cache.update_state(CACHE_ENERGY_COLLECTION, "")
552553
await node_cache.save_cache()
553554

554-
# Clear PulseCollection._logs
555+
# Reset the PulseCollection
555556
pulse_collection = PulseCollection(mac)
556557
pulse_collection.reset()
557558

559+
# Clear PlugwiseCircle._current_log_address
560+
circle = PlugwiseCircle(mac, address(?))
561+
circle._current_log_address = 0
562+
558563
async def set_energy_intervals(
559564
self, mac: str, consumption: int, production: int
560565
) -> None:

0 commit comments

Comments
 (0)