From c50597594003c09f516f91d0a55b824243db6718 Mon Sep 17 00:00:00 2001 From: Kevin Worrel <37058192+dieselrabbit@users.noreply.github.com> Date: Tue, 7 Feb 2023 12:13:06 -0800 Subject: [PATCH] Use library data to map state class for ScreenLogic (#87649) Co-authored-by: J. Nick Koston --- homeassistant/components/screenlogic/binary_sensor.py | 2 +- homeassistant/components/screenlogic/manifest.json | 2 +- homeassistant/components/screenlogic/sensor.py | 4 +--- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/screenlogic/binary_sensor.py b/homeassistant/components/screenlogic/binary_sensor.py index e952a6104c4..81376a2a453 100644 --- a/homeassistant/components/screenlogic/binary_sensor.py +++ b/homeassistant/components/screenlogic/binary_sensor.py @@ -35,7 +35,6 @@ async def async_setup_entry( config_entry.entry_id ] gateway_data = coordinator.gateway_data - chemistry = gateway_data[SL_DATA.KEY_CHEMISTRY] config = gateway_data[SL_DATA.KEY_CONFIG] # Generic binary sensor @@ -52,6 +51,7 @@ async def async_setup_entry( ) if config["equipment_flags"] & EQUIPMENT.FLAG_INTELLICHEM: + chemistry = gateway_data[SL_DATA.KEY_CHEMISTRY] # IntelliChem alarm sensors entities.extend( [ diff --git a/homeassistant/components/screenlogic/manifest.json b/homeassistant/components/screenlogic/manifest.json index 12327ac6ac1..173a6b26765 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.7.0"], + "requirements": ["screenlogicpy==0.7.1"], "codeowners": ["@dieselrabbit", "@bdraco"], "dhcp": [ { "registered_devices": true }, diff --git a/homeassistant/components/screenlogic/sensor.py b/homeassistant/components/screenlogic/sensor.py index d4575f2d066..b27cb18b9c3 100644 --- a/homeassistant/components/screenlogic/sensor.py +++ b/homeassistant/components/screenlogic/sensor.py @@ -206,9 +206,7 @@ class ScreenLogicSensorEntity(ScreenlogicEntity, SensorEntity): state_type = self.sensor.get("state_type") if self._data_key == "scg_super_chlor_timer": return None - return SL_STATE_TYPE_TO_HA_STATE_CLASS.get( - state_type, SensorStateClass.MEASUREMENT - ) + return SL_STATE_TYPE_TO_HA_STATE_CLASS.get(state_type) @property def options(self) -> list[str] | None: diff --git a/requirements_all.txt b/requirements_all.txt index a21dc40911f..cf35eeeb882 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2297,7 +2297,7 @@ satel_integra==0.3.7 scapy==2.5.0 # homeassistant.components.screenlogic -screenlogicpy==0.7.0 +screenlogicpy==0.7.1 # homeassistant.components.scsgate scsgate==0.1.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 0bfaafc8c84..93dfb64c3be 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1618,7 +1618,7 @@ samsungtvws[async,encrypted]==2.5.0 scapy==2.5.0 # homeassistant.components.screenlogic -screenlogicpy==0.7.0 +screenlogicpy==0.7.1 # homeassistant.components.backup securetar==2022.2.0