Skip to content

Commit ecfad81

Browse files
committed
Move code-block up
1 parent e6b2225 commit ecfad81

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

plugwise_usb/nodes/helpers/pulses.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,13 @@ def _update_log_direction(
521521
elif self._log_production is None:
522522
self._log_production = False
523523

524+
prev_prev_address, prev_prev_slot = calc_log_address(address, slot, -2)
525+
if self._log_exists(prev_prev_address, prev_prev_slot):
526+
timestamp_3 = self._logs[prev_prev_address][prev_prev_slot].timestamp
527+
self._log_production = (
528+
timestamp_2 == timestamp and timestamp_3 != timestamp
529+
) or (timestamp_2 == timestamp_3 and timestamp_2 != timestamp)
530+
524531
next_address, next_slot = calc_log_address(address, slot, 1)
525532
if self._log_exists(next_address, next_slot):
526533
if self._logs[next_address][next_slot].timestamp == timestamp:
@@ -537,13 +544,6 @@ def _update_log_direction(
537544
elif self._log_production is None:
538545
self._log_production = False
539546

540-
prev_prev_address, prev_prev_slot = calc_log_address(address, slot, -2)
541-
if self._log_exists(prev_prev_address, prev_prev_slot):
542-
timestamp_3 = self._logs[prev_prev_address][prev_prev_slot].timestamp
543-
self._log_production = (
544-
timestamp_2 == timestamp and timestamp_3 != timestamp
545-
) or (timestamp_2 == timestamp_3 and timestamp_2 != timestamp)
546-
547547
def _update_log_interval(self) -> None:
548548
"""Update the detected log interval based on the most recent two logs."""
549549
if self._logs is None or self._log_production is None:

0 commit comments

Comments
 (0)