Use new enums in solaredge_local (#62374)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-12-20 15:58:25 +01:00 committed by GitHub
parent 28af0b4092
commit 0cc1a7b9bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,13 +14,13 @@ import voluptuous as vol
from homeassistant.components.sensor import ( from homeassistant.components.sensor import (
PLATFORM_SCHEMA, PLATFORM_SCHEMA,
SensorDeviceClass,
SensorEntity, SensorEntity,
SensorEntityDescription, SensorEntityDescription,
) )
from homeassistant.const import ( from homeassistant.const import (
CONF_IP_ADDRESS, CONF_IP_ADDRESS,
CONF_NAME, CONF_NAME,
DEVICE_CLASS_TEMPERATURE,
ELECTRIC_CURRENT_AMPERE, ELECTRIC_CURRENT_AMPERE,
ELECTRIC_POTENTIAL_VOLT, ELECTRIC_POTENTIAL_VOLT,
ENERGY_WATT_HOUR, ENERGY_WATT_HOUR,
@ -129,7 +129,7 @@ SENSOR_TYPES: tuple[SolarEdgeLocalSensorEntityDescription, ...] = (
name="Average Optimizer Temperature", name="Average Optimizer Temperature",
native_unit_of_measurement=TEMP_CELSIUS, native_unit_of_measurement=TEMP_CELSIUS,
icon="mdi:solar-panel", icon="mdi:solar-panel",
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
), ),
SolarEdgeLocalSensorEntityDescription( SolarEdgeLocalSensorEntityDescription(
key="optimizervoltage", key="optimizervoltage",
@ -144,7 +144,7 @@ SENSOR_TYPE_INVERTER_TEMPERATURE = SolarEdgeLocalSensorEntityDescription(
name="Inverter Temperature", name="Inverter Temperature",
native_unit_of_measurement=TEMP_CELSIUS, native_unit_of_measurement=TEMP_CELSIUS,
extra_attribute="operating_mode", extra_attribute="operating_mode",
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
) )
SENSOR_TYPES_ENERGY_IMPORT: tuple[SolarEdgeLocalSensorEntityDescription, ...] = ( SENSOR_TYPES_ENERGY_IMPORT: tuple[SolarEdgeLocalSensorEntityDescription, ...] = (