mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Avoid creating door sensor when it does no exist on older yalexs_ble locks (#76710)
This commit is contained in:
parent
bac44cf473
commit
b4a840c00d
@ -23,7 +23,9 @@ async def async_setup_entry(
|
||||
) -> None:
|
||||
"""Set up YALE XS binary sensors."""
|
||||
data: YaleXSBLEData = hass.data[DOMAIN][entry.entry_id]
|
||||
async_add_entities([YaleXSBLEDoorSensor(data)])
|
||||
lock = data.lock
|
||||
if lock.lock_info and lock.lock_info.door_sense:
|
||||
async_add_entities([YaleXSBLEDoorSensor(data)])
|
||||
|
||||
|
||||
class YaleXSBLEDoorSensor(YALEXSBLEEntity, BinarySensorEntity):
|
||||
|
Loading…
x
Reference in New Issue
Block a user