From b4274e4a26da9bfd78b3c33b6b07aad247e4f21e Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 19 Dec 2022 13:17:57 +0100 Subject: [PATCH] Add POWER device class to goodwe number (#84232) --- homeassistant/components/goodwe/number.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/goodwe/number.py b/homeassistant/components/goodwe/number.py index b8196b05252..10a825aaa3c 100644 --- a/homeassistant/components/goodwe/number.py +++ b/homeassistant/components/goodwe/number.py @@ -7,9 +7,13 @@ import logging from goodwe import Inverter, InverterError -from homeassistant.components.number import NumberEntity, NumberEntityDescription +from homeassistant.components.number import ( + NumberDeviceClass, + NumberEntity, + NumberEntityDescription, +) from homeassistant.config_entries import ConfigEntry -from homeassistant.const import PERCENTAGE, POWER_WATT +from homeassistant.const import PERCENTAGE, UnitOfPower from homeassistant.core import HomeAssistant from homeassistant.helpers.entity import DeviceInfo, EntityCategory from homeassistant.helpers.entity_platform import AddEntitiesCallback @@ -42,7 +46,8 @@ NUMBERS = ( name="Grid export limit", icon="mdi:transmission-tower", entity_category=EntityCategory.CONFIG, - native_unit_of_measurement=POWER_WATT, + device_class=NumberDeviceClass.POWER, + native_unit_of_measurement=UnitOfPower.WATT, native_step=100, native_min_value=0, native_max_value=10000,