Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #188 from jwillemsen/jwi-ha2023110
Browse files Browse the repository at this point in the history
Simplified entity_category, fixes HA 2023.11.0 incompatiblities, fixe…
  • Loading branch information
jwillemsen authored Nov 3, 2023
2 parents 44633a7 + a58b016 commit d769f71
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions custom_components/daikin_residential_altherma/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,29 +363,6 @@ def device_info(self):

@property
def entity_category(self):
"""
Return the entity_category the sensor.
CONFIG:Set to config for an entity which allows changing the configuration
of a device, for example a switch entity making it possible to turn the
background illumination of a switch on and off.
DIAGNOSTIC: Set to diagnostic for an entity exposing some configuration
parameter or diagnostics of a device but does not allow changing it,
SYSTEM: Set to system for an entity which is not useful for the user
to interact with. """

configList = [
ATTR_SETPOINT_MODE,
ATTR_OPERATION_MODE,
ATTR_TANK_SETPOINT_MODE,
ATTR_TANK_OPERATION_MODE,
ATTR_CONTROL_MODE,
ATTR_IS_HOLIDAY_MODE_ACTIVE,
ATTR_TANK_HEATUP_MODE,
ATTR_TANK_IS_HOLIDAY_MODE_ACTIVE,
ATTR_TANK_IS_POWERFUL_MODE_ACTIVE
]
diagnosticList =[
ATTR_IS_IN_EMERGENCY_STATE,
ATTR_IS_IN_ERROR_STATE,
Expand All @@ -404,13 +381,8 @@ def entity_category(self):
ATTR_SERIAL_NUMBER,
]
try:
if self._device_attribute in configList:
self._entity_category = EntityCategory.CONFIG
return self._entity_category
elif self._device_attribute in diagnosticList:
self._entity_category = EntityCategory.DIAGNOSTIC
return self._entity_category

if self._device_attribute in diagnosticList:
return EntityCategory.DIAGNOSTIC
else:
return None
except Exception as e:
Expand Down

0 comments on commit d769f71

Please sign in to comment.