Skip to content

Commit b22296b

Browse files
committed
Pylint fixes
1 parent 4ee8051 commit b22296b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugwise_usb/nodes/circle.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,16 +667,16 @@ async def set_relay_lock(self, state: bool) -> bool:
667667

668668
async def _relay_load_from_cache(self) -> bool:
669669
"""Load relay state from cache."""
670+
result = True
670671
if (cached_relay_data := self._get_cache(CACHE_RELAY)) is not None:
671672
_LOGGER.debug(
672673
"Restore relay state from cache for node %s: relay: %s",
673674
self._mac_in_str,
674675
cached_relay_data,
675676
)
676677

677-
relay_state = False if cached_relay_data == "True" else True
678+
relay_state = cached_relay_data != "True"
678679
await self._relay_update_state(relay_state)
679-
result = True
680680
else:
681681
_LOGGER.debug(
682682
"Failed to restore relay state from cache for node %s, try to request node info...",
@@ -691,7 +691,7 @@ async def _relay_load_from_cache(self) -> bool:
691691
self._mac_in_str,
692692
cached_relay_lock,
693693
)
694-
relay_lock = False if cached_relay_lock == "True" else True
694+
relay_lock = cached_relay_lock != "True"
695695
await self._relay_update_lock(relay_lock)
696696
else:
697697
# Set to initial state False when not present in cache

0 commit comments

Comments
 (0)