File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 1+ import logging
12from typing import Any
23
34from plugp100 .new .components .device_component import DeviceComponent
45
56
7+ _LOGGER = logging .getLogger ("SmartDoorComponent" )
8+
69# TODO: get component_negotiation for Tapo Smart Door sensor
710# this class is actually too specific for SmartDoor, the component can be called open_closed
811
@@ -12,4 +15,9 @@ def __init__(self):
1215 self .is_open = False
1316
1417 async def update (self , current_state : dict [str , Any ] | None = None ):
15- self .is_open = current_state ["is_open" ]
18+ if "is_open" in current_state :
19+ self .is_open = current_state ["is_open" ]
20+ elif "open" in current_state :
21+ self .is_open = current_state ["open" ]
22+ else :
23+ _LOGGER .warning ("Open state not found in current state" )
You can’t perform that action at this time.
0 commit comments