diff --git a/homeassistant/components/pvoutput/sensor.py b/homeassistant/components/pvoutput/sensor.py index 1d8b3400d8b..4f745666020 100644 --- a/homeassistant/components/pvoutput/sensor.py +++ b/homeassistant/components/pvoutput/sensor.py @@ -9,10 +9,10 @@ import voluptuous as vol from homeassistant.components.rest.data import RestData from homeassistant.components.sensor import ( - DEVICE_CLASS_ENERGY, PLATFORM_SCHEMA, - STATE_CLASS_TOTAL_INCREASING, + SensorDeviceClass, SensorEntity, + SensorStateClass, ) from homeassistant.const import ( ATTR_DATE, @@ -74,8 +74,8 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= class PvoutputSensor(SensorEntity): """Representation of a PVOutput sensor.""" - _attr_state_class = STATE_CLASS_TOTAL_INCREASING - _attr_device_class = DEVICE_CLASS_ENERGY + _attr_state_class = SensorStateClass.TOTAL_INCREASING + _attr_device_class = SensorDeviceClass.ENERGY _attr_native_unit_of_measurement = ENERGY_WATT_HOUR def __init__(self, rest, name):