Add entity category to ZHA battery (#58553)

pull/58562/head
Paulus Schoutsen 2021-10-27 16:28:10 -07:00 committed by GitHub
parent e1e864d2b6
commit 366a4d24f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -35,6 +35,7 @@ from homeassistant.const import (
ELECTRIC_CURRENT_AMPERE,
ELECTRIC_POTENTIAL_VOLT,
ENERGY_KILO_WATT_HOUR,
ENTITY_CATEGORY_DIAGNOSTIC,
LIGHT_LUX,
PERCENTAGE,
POWER_WATT,
@ -223,6 +224,7 @@ class Battery(Sensor):
_device_class = DEVICE_CLASS_BATTERY
_state_class = STATE_CLASS_MEASUREMENT
_unit = PERCENTAGE
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC
@staticmethod
def formatter(value: int) -> int: