Use library data to map state class for ScreenLogic (#87649)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
e84a11963e
commit
c505975940
5 changed files with 5 additions and 7 deletions
|
@ -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(
|
||||
[
|
||||
|
|
|
@ -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 },
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue