Add state_class to current bandwith sensors for bbox integration (#58086)

* Add state_class to current bandwith sensors

* Fix isort test
pull/58202/head
David Le Brun 2021-10-20 14:53:14 +02:00 committed by GitHub
parent c75346addc
commit 2bd64cec11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import voluptuous as vol
from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
STATE_CLASS_MEASUREMENT,
SensorEntity,
SensorEntityDescription,
)
@ -48,12 +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,
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,
icon="mdi:upload",
),
SensorEntityDescription(