Make numeric device classes a constant (#127354)
noticed this shows up on the profile every time the UI loads
This commit is contained in:
parent
ddea61148f
commit
ff7bc13058
1 changed files with 3 additions and 2 deletions
|
@ -16,6 +16,8 @@ from .const import (
|
|||
SensorDeviceClass,
|
||||
)
|
||||
|
||||
_NUMERIC_DEVICE_CLASSES = list(set(SensorDeviceClass) - NON_NUMERIC_DEVICE_CLASSES)
|
||||
|
||||
|
||||
@callback
|
||||
def async_setup(hass: HomeAssistant) -> None:
|
||||
|
@ -55,7 +57,6 @@ def ws_numeric_device_classes(
|
|||
hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]
|
||||
) -> None:
|
||||
"""Return numeric sensor device classes."""
|
||||
numeric_device_classes = set(SensorDeviceClass) - NON_NUMERIC_DEVICE_CLASSES
|
||||
connection.send_result(
|
||||
msg["id"], {"numeric_device_classes": list(numeric_device_classes)}
|
||||
msg["id"], {"numeric_device_classes": _NUMERIC_DEVICE_CLASSES}
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue