diff --git a/homeassistant/components/bbox/sensor.py b/homeassistant/components/bbox/sensor.py index fc9c8982733..5ab897de797 100644 --- a/homeassistant/components/bbox/sensor.py +++ b/homeassistant/components/bbox/sensor.py @@ -10,15 +10,15 @@ import voluptuous as vol from homeassistant.components.sensor import ( PLATFORM_SCHEMA, - STATE_CLASS_MEASUREMENT, + SensorDeviceClass, SensorEntity, SensorEntityDescription, + SensorStateClass, ) from homeassistant.const import ( CONF_MONITORED_VARIABLES, CONF_NAME, DATA_RATE_MEGABITS_PER_SECOND, - DEVICE_CLASS_TIMESTAMP, ) import homeassistant.helpers.config_validation as cv from homeassistant.util import Throttle @@ -49,14 +49,14 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = ( key="current_down_bandwidth", name="Currently Used Download Bandwidth", native_unit_of_measurement=DATA_RATE_MEGABITS_PER_SECOND, - state_class=STATE_CLASS_MEASUREMENT, + state_class=SensorStateClass.MEASUREMENT, icon="mdi:download", ), SensorEntityDescription( key="current_up_bandwidth", name="Currently Used Upload Bandwidth", native_unit_of_measurement=DATA_RATE_MEGABITS_PER_SECOND, - state_class=STATE_CLASS_MEASUREMENT, + state_class=SensorStateClass.MEASUREMENT, icon="mdi:upload", ), SensorEntityDescription( @@ -120,7 +120,7 @@ class BboxUptimeSensor(SensorEntity): """Bbox uptime sensor.""" _attr_attribution = ATTRIBUTION - _attr_device_class = DEVICE_CLASS_TIMESTAMP + _attr_device_class = SensorDeviceClass.TIMESTAMP def __init__(self, bbox_data, name, description: SensorEntityDescription): """Initialize the sensor."""