File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
custom_components/span_panel Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ class SpanPanelBinarySensorEntityDescription(
4141 key = "doorState" ,
4242 name = "Door State" ,
4343 device_class = BinarySensorDeviceClass .TAMPER ,
44- value_fn = lambda status_data : status_data .is_door_closed ,
44+ value_fn = lambda status_data : not status_data .is_door_closed , #invert logic for tamper
4545 ),
4646 SpanPanelBinarySensorEntityDescription (
4747 key = "eth0Link" ,
Original file line number Diff line number Diff line change 66
77SYSTEM_DOOR_STATE_CLOSED = "CLOSED"
88SYSTEM_DOOR_STATE_OPEN = "OPEN"
9+ SYSTEM_DOOR_STATE_UNKNOWN = "UNKNOWN"
910
1011
1112@dataclass
@@ -26,7 +27,9 @@ class SpanPanelHardwareStatus:
2627 _system_data : Dict [str , Any ] = field (default_factory = dict )
2728
2829 @property
29- def is_door_closed (self ) -> bool :
30+ def is_door_closed (self ) -> bool | None :
31+ if (self .door_state == SYSTEM_DOOR_STATE_UNKNOWN ):
32+ return None
3033 return self .door_state == SYSTEM_DOOR_STATE_CLOSED
3134
3235 @property
You can’t perform that action at this time.
0 commit comments