Skip to content

Commit d67d231

Browse files
committed
Implement improved guarding as suggested
1 parent 093874e commit d67d231

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugwise_usb/nodes/circle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,10 +532,10 @@ async def _energy_log_records_load_from_cache(self) -> bool:
532532
)
533533
return False
534534
restored_logs: dict[int, list[int]] = {}
535-
log_data = cache_data.split("|")
536-
if len(log_data) == 0:
535+
if cache_data == "":
537536
return False
538537

538+
log_data = cache_data.split("|")
539539
for log_record in log_data:
540540
log_fields = log_record.split(":")
541541
if len(log_fields) == 4:

0 commit comments

Comments
 (0)