Skip to content

Commit 09bae00

Browse files
committed
Make auto_update_first_run local
1 parent 2553027 commit 09bae00

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

plugwise/stick.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ def __init__(self, port, callback=None, print_progress=False):
128128
self._run_update_thread = False
129129

130130
self._auto_update_timer = None
131-
self._auto_update_first_run = None
132131
self._nodes_discovered = None
133132
self._receive_timeout_thread = None
134133
self._run_watchdog = None
@@ -1367,7 +1366,7 @@ def _update_loop(self): # noqa: C901
13671366
"""
13681367
# TODO: flake8 indicates scan is too complex, level 28 indenting is indeed complex
13691368
self._run_update_thread = True
1370-
self._auto_update_first_run = True
1369+
_auto_update_first_run = True
13711370
day_of_month = datetime.now().day
13721371
try:
13731372
while self._run_update_thread:
@@ -1425,7 +1424,7 @@ def _update_loop(self): # noqa: C901
14251424
):
14261425
# Don't check at first time
14271426
_LOGGER.debug("Request current power usage for node %s", mac)
1428-
if not self._auto_update_first_run and self._run_update_thread:
1427+
if not _auto_update_first_run and self._run_update_thread:
14291428
# Only request update if node is available
14301429
if self._plugwise_nodes[mac].get_available():
14311430
_LOGGER.debug(
@@ -1473,7 +1472,7 @@ def _update_loop(self): # noqa: C901
14731472
mac,
14741473
)
14751474
self._plugwise_nodes[mac].update_power_usage()
1476-
self._auto_update_first_run = False
1475+
_auto_update_first_run = False
14771476

14781477
# Sync internal clock of all available Circle and Circle+ nodes once a day
14791478
if datetime.now().day != day_of_month:

0 commit comments

Comments
 (0)