Skip to content

Commit eab14a4

Browse files
committed
EntityCategory not supported yet. Use string. #4
1 parent 9180e15 commit eab14a4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

custom_components/amshan/sensor.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
async_dispatcher_connect,
4040
async_dispatcher_send,
4141
)
42-
from homeassistant.helpers.entity import DeviceInfo, Entity, EntityCategory
42+
from homeassistant.helpers.entity import DeviceInfo, Entity
4343
from homeassistant.helpers.typing import HomeAssistantType
4444

4545
from . import MeterInfo
@@ -66,7 +66,7 @@ class EntitySetup(NamedTuple):
6666
use_configured_scaling: bool
6767

6868
"""The category of the entity, if any."""
69-
entity_category: Union[EntityCategory, str, None]
69+
entity_category: Union[str, None]
7070

7171
"""The device class of entity, if any."""
7272
device_class: Optional[str]
@@ -109,7 +109,7 @@ class NorhanEntity(SensorEntity):
109109
ENTITY_SETUPS: ClassVar[Dict[str, EntitySetup]] = {
110110
obis_map.NEK_HAN_FIELD_METER_ID: EntitySetup(
111111
False,
112-
EntityCategory.DIAGNOSTIC,
112+
"diagnostic",
113113
None,
114114
None,
115115
None,
@@ -120,7 +120,7 @@ class NorhanEntity(SensorEntity):
120120
),
121121
obis_map.NEK_HAN_FIELD_METER_MANUFACTURER: EntitySetup(
122122
False,
123-
EntityCategory.DIAGNOSTIC,
123+
"diagnostic",
124124
None,
125125
None,
126126
None,
@@ -131,7 +131,7 @@ class NorhanEntity(SensorEntity):
131131
),
132132
obis_map.NEK_HAN_FIELD_METER_TYPE: EntitySetup(
133133
False,
134-
EntityCategory.DIAGNOSTIC,
134+
"diagnostic",
135135
None,
136136
None,
137137
None,
@@ -142,7 +142,7 @@ class NorhanEntity(SensorEntity):
142142
),
143143
obis_map.NEK_HAN_FIELD_OBIS_LIST_VER_ID: EntitySetup(
144144
False,
145-
EntityCategory.DIAGNOSTIC,
145+
"diagnostic",
146146
None,
147147
None,
148148
None,
@@ -451,7 +451,7 @@ def icon(self) -> Optional[str]:
451451
return self._entity_setup.icon
452452

453453
@property
454-
def entity_category(self) -> Union[EntityCategory, str, None]:
454+
def entity_category(self) -> Union[str, None]:
455455
"""Return the category of the entity, if any."""
456456
return self._entity_setup.entity_category
457457

0 commit comments

Comments
 (0)