mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +00:00
Add entity category to ZHA battery (#58553)
This commit is contained in:
parent
e1e864d2b6
commit
366a4d24f4
@ -35,6 +35,7 @@ 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,
|
||||||
LIGHT_LUX,
|
LIGHT_LUX,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
POWER_WATT,
|
POWER_WATT,
|
||||||
@ -223,6 +224,7 @@ class Battery(Sensor):
|
|||||||
_device_class = DEVICE_CLASS_BATTERY
|
_device_class = DEVICE_CLASS_BATTERY
|
||||||
_state_class = STATE_CLASS_MEASUREMENT
|
_state_class = STATE_CLASS_MEASUREMENT
|
||||||
_unit = PERCENTAGE
|
_unit = PERCENTAGE
|
||||||
|
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def formatter(value: int) -> int:
|
def formatter(value: int) -> int:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user