From 31725d541138b91df000daaf3b5c6596c1d81613 Mon Sep 17 00:00:00 2001 From: John Pettitt Date: Wed, 7 Dec 2022 06:53:00 -0800 Subject: [PATCH] Add leak detectors support for Ambient Station (#83357) --- .../ambient_station/binary_sensor.py | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/homeassistant/components/ambient_station/binary_sensor.py b/homeassistant/components/ambient_station/binary_sensor.py index bcc2ae60404..67a54906e92 100644 --- a/homeassistant/components/ambient_station/binary_sensor.py +++ b/homeassistant/components/ambient_station/binary_sensor.py @@ -31,6 +31,10 @@ TYPE_BATT9 = "batt9" TYPE_BATTIN = "battin" TYPE_BATTOUT = "battout" TYPE_BATT_CO2 = "batt_co2" +TYPE_BATT_LEAK1 = "batleak1" +TYPE_BATT_LEAK2 = "batleak2" +TYPE_BATT_LEAK3 = "batleak3" +TYPE_BATT_LEAK4 = "batleak4" TYPE_BATT_LIGHTNING = "batt_lightning" TYPE_BATT_SM1 = "battsm1" TYPE_BATT_SM10 = "battsm10" @@ -42,6 +46,10 @@ TYPE_BATT_SM6 = "battsm6" TYPE_BATT_SM7 = "battsm7" TYPE_BATT_SM8 = "battsm8" TYPE_BATT_SM9 = "battsm9" +TYPE_LEAK1 = "leak1" +TYPE_LEAK2 = "leak2" +TYPE_LEAK3 = "leak3" +TYPE_LEAK4 = "leak4" TYPE_PM25IN_BATT = "batt_25in" TYPE_PM25_BATT = "batt_25" TYPE_RELAY1 = "relay1" @@ -155,6 +163,34 @@ BINARY_SENSOR_DESCRIPTIONS = ( entity_category=EntityCategory.DIAGNOSTIC, on_state=0, ), + AmbientBinarySensorDescription( + key=TYPE_BATT_LEAK1, + name="Leak detector battery 1", + device_class=BinarySensorDeviceClass.BATTERY, + entity_category=EntityCategory.DIAGNOSTIC, + on_state=0, + ), + AmbientBinarySensorDescription( + key=TYPE_BATT_LEAK2, + name="Leak detector battery 2", + device_class=BinarySensorDeviceClass.BATTERY, + entity_category=EntityCategory.DIAGNOSTIC, + on_state=0, + ), + AmbientBinarySensorDescription( + key=TYPE_BATT_LEAK3, + name="Leak detector battery 3", + device_class=BinarySensorDeviceClass.BATTERY, + entity_category=EntityCategory.DIAGNOSTIC, + on_state=0, + ), + AmbientBinarySensorDescription( + key=TYPE_BATT_LEAK4, + name="Leak detector battery 4", + device_class=BinarySensorDeviceClass.BATTERY, + entity_category=EntityCategory.DIAGNOSTIC, + on_state=0, + ), AmbientBinarySensorDescription( key=TYPE_BATT_SM1, name="Soil monitor battery 1", @@ -239,6 +275,30 @@ BINARY_SENSOR_DESCRIPTIONS = ( entity_category=EntityCategory.DIAGNOSTIC, on_state=0, ), + AmbientBinarySensorDescription( + key=TYPE_LEAK1, + name="Leak detector 1", + device_class=BinarySensorDeviceClass.MOISTURE, + on_state=1, + ), + AmbientBinarySensorDescription( + key=TYPE_LEAK2, + name="Leak detector 2", + device_class=BinarySensorDeviceClass.MOISTURE, + on_state=1, + ), + AmbientBinarySensorDescription( + key=TYPE_LEAK3, + name="Leak detector 3", + device_class=BinarySensorDeviceClass.MOISTURE, + on_state=1, + ), + AmbientBinarySensorDescription( + key=TYPE_LEAK4, + name="Leak detector 4", + device_class=BinarySensorDeviceClass.MOISTURE, + on_state=1, + ), AmbientBinarySensorDescription( key=TYPE_PM25IN_BATT, name="PM25 indoor battery",