From 21cdb6ece3ee7031bb1a771b58a8010f1b50655d Mon Sep 17 00:00:00 2001 From: Kevin Worrel <37058192+dieselrabbit@users.noreply.github.com> Date: Fri, 13 Jan 2023 14:58:23 -0500 Subject: [PATCH] Bump screenlogicpy to 0.6.3 (#85799) Co-authored-by: J. Nick Koston fixes undefined --- .../components/screenlogic/binary_sensor.py | 24 +++++++++++++++++++ .../components/screenlogic/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/screenlogic/binary_sensor.py b/homeassistant/components/screenlogic/binary_sensor.py index 61e06490feb..f9bf1d3c72d 100644 --- a/homeassistant/components/screenlogic/binary_sensor.py +++ b/homeassistant/components/screenlogic/binary_sensor.py @@ -15,6 +15,13 @@ from .const import DOMAIN SL_DEVICE_TYPE_TO_HA_DEVICE_CLASS = {DEVICE_TYPE.ALARM: BinarySensorDeviceClass.PROBLEM} +SUPPORTED_CONFIG_BINARY_SENSORS = ( + "freeze_mode", + "pool_delay", + "spa_delay", + "cleaner_delay", +) + async def async_setup_entry( hass: HomeAssistant, @@ -28,6 +35,14 @@ async def async_setup_entry( # Generic binary sensor entities.append(ScreenLogicBinarySensor(coordinator, "chem_alarm")) + entities.extend( + [ + ScreenlogicConfigBinarySensor(coordinator, cfg_sensor) + for cfg_sensor in coordinator.data[SL_DATA.KEY_CONFIG] + if cfg_sensor in SUPPORTED_CONFIG_BINARY_SENSORS + ] + ) + if ( coordinator.data[SL_DATA.KEY_CONFIG]["equipment_flags"] & EQUIPMENT.FLAG_INTELLICHEM @@ -119,3 +134,12 @@ class ScreenlogicSCGBinarySensor(ScreenLogicBinarySensor): def sensor(self): """Shortcut to access the sensor data.""" return self.coordinator.data[SL_DATA.KEY_SCG][self._data_key] + + +class ScreenlogicConfigBinarySensor(ScreenLogicBinarySensor): + """Representation of a ScreenLogic config data binary sensor entity.""" + + @property + def sensor(self): + """Shortcut to access the sensor data.""" + return self.coordinator.data[SL_DATA.KEY_CONFIG][self._data_key] diff --git a/homeassistant/components/screenlogic/manifest.json b/homeassistant/components/screenlogic/manifest.json index 3d43d729cdf..2a58722b13b 100644 --- a/homeassistant/components/screenlogic/manifest.json +++ b/homeassistant/components/screenlogic/manifest.json @@ -3,7 +3,7 @@ "name": "Pentair ScreenLogic", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/screenlogic", - "requirements": ["screenlogicpy==0.6.2"], + "requirements": ["screenlogicpy==0.6.3"], "codeowners": ["@dieselrabbit", "@bdraco"], "dhcp": [ { "registered_devices": true }, diff --git a/requirements_all.txt b/requirements_all.txt index 8e563df7eac..a5ab05e3684 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2278,7 +2278,7 @@ satel_integra==0.3.7 scapy==2.5.0 # homeassistant.components.screenlogic -screenlogicpy==0.6.2 +screenlogicpy==0.6.3 # homeassistant.components.scsgate scsgate==0.1.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 0a190b373a6..decbe441a39 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1599,7 +1599,7 @@ samsungtvws[async,encrypted]==2.5.0 scapy==2.5.0 # homeassistant.components.screenlogic -screenlogicpy==0.6.2 +screenlogicpy==0.6.3 # homeassistant.components.backup securetar==2022.2.0