mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Use new enums in tasmota (#62427)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
69df7bc43d
commit
3724a4fb2f
@ -22,7 +22,6 @@ from homeassistant.const import (
|
|||||||
ELECTRIC_CURRENT_AMPERE,
|
ELECTRIC_CURRENT_AMPERE,
|
||||||
ELECTRIC_POTENTIAL_VOLT,
|
ELECTRIC_POTENTIAL_VOLT,
|
||||||
ENERGY_KILO_WATT_HOUR,
|
ENERGY_KILO_WATT_HOUR,
|
||||||
ENTITY_CATEGORY_DIAGNOSTIC,
|
|
||||||
FREQUENCY_HERTZ,
|
FREQUENCY_HERTZ,
|
||||||
LENGTH_CENTIMETERS,
|
LENGTH_CENTIMETERS,
|
||||||
LIGHT_LUX,
|
LIGHT_LUX,
|
||||||
@ -42,6 +41,7 @@ from homeassistant.const import (
|
|||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
|
from homeassistant.helpers.entity import EntityCategory
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .const import DATA_REMOVE_DISCOVER_COMPONENT
|
from .const import DATA_REMOVE_DISCOVER_COMPONENT
|
||||||
@ -277,7 +277,7 @@ class TasmotaSensor(TasmotaAvailability, TasmotaDiscoveryUpdate, SensorEntity):
|
|||||||
def entity_category(self) -> str | None:
|
def entity_category(self) -> str | None:
|
||||||
"""Return the category of the entity, if any."""
|
"""Return the category of the entity, if any."""
|
||||||
if self._tasmota_entity.quantity in status_sensor.SENSORS:
|
if self._tasmota_entity.quantity in status_sensor.SENSORS:
|
||||||
return ENTITY_CATEGORY_DIAGNOSTIC
|
return EntityCategory.DIAGNOSTIC
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user