Add POWER device class to goodwe number (#84232)

This commit is contained in:
epenet 2022-12-19 13:17:57 +01:00 committed by GitHub
parent 429dbd4215
commit b4274e4a26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,