Add and use bunch of data size and rate related constants (#31781)
Also fix a few units to match the corresponding data.
This commit is contained in:
1 parent
0173c61fee
commit
3e23a3a860
41 files changed
+349
-223
No files matched your search
@@ -11,6 +11,7 @@ from homeassistant.const import (
|
||||
ATTR_ATTRIBUTION,
|
||||
CONF_MONITORED_VARIABLES,
|
||||
CONF_NAME,
|
||||
DATA_RATE_MEGABITS_PER_SECOND,
|
||||
DEVICE_CLASS_TIMESTAMP,
|
||||
)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
@@ -20,8 +21,6 @@ from homeassistant.util.dt import utcnow
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
BANDWIDTH_MEGABITS_SECONDS = "Mb/s"
|
||||
|
||||
ATTRIBUTION = "Powered by Bouygues Telecom"
|
||||
|
||||
DEFAULT_NAME = "Bbox"
|
||||
@@ -32,22 +31,22 @@ MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=60)
|
||||
SENSOR_TYPES = {
|
||||
"down_max_bandwidth": [
|
||||
"Maximum Download Bandwidth",
|
||||
BANDWIDTH_MEGABITS_SECONDS,
|
||||
DATA_RATE_MEGABITS_PER_SECOND,
|
||||
"mdi:download",
|
||||
],
|
||||
"up_max_bandwidth": [
|
||||
"Maximum Upload Bandwidth",
|
||||
BANDWIDTH_MEGABITS_SECONDS,
|
||||
DATA_RATE_MEGABITS_PER_SECOND,
|
||||
"mdi:upload",
|
||||
],
|
||||
"current_down_bandwidth": [
|
||||
"Currently Used Download Bandwidth",
|
||||
BANDWIDTH_MEGABITS_SECONDS,
|
||||
DATA_RATE_MEGABITS_PER_SECOND,
|
||||
"mdi:download",
|
||||
],
|
||||
"current_up_bandwidth": [
|
||||
"Currently Used Upload Bandwidth",
|
||||
BANDWIDTH_MEGABITS_SECONDS,
|
||||
DATA_RATE_MEGABITS_PER_SECOND,
|
||||
"mdi:upload",
|
||||
],
|
||||
"uptime": ["Uptime", None, "mdi:clock"],
|
||||
|
||||
Reference in new issue
Block a user