File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ async def async_setup_entry(
34
34
return
35
35
36
36
locks = await sector_hub .get_locks ()
37
+ if not locks :
38
+ return
37
39
lockdevices : list = []
38
40
for lock in locks :
39
41
name = await sector_hub .get_name (lock , "lock" )
@@ -122,6 +124,6 @@ async def async_lock(self, **kwargs) -> None:
122
124
def _handle_coordinator_update (self ) -> None :
123
125
"""Handle updated data from the coordinator."""
124
126
self ._attr_is_locked = bool (
125
- self ._hub .lock_state [self .entity_description .key ] == STATE_LOCKED
127
+ self ._hub .lock_state [self .entity_description .key ] == "lock"
126
128
)
127
129
self .async_write_ha_state ()
Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ async def async_setup_entry(
32
32
]
33
33
34
34
switches = await sector_hub .get_switches ()
35
+ if not switches :
36
+ return
35
37
switchlist : list = []
36
38
for switch in switches :
37
39
name = await sector_hub .get_name (switch , "switch" )
You can’t perform that action at this time.
0 commit comments