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:
Ville Skyttä authored and GitHub committed 2020-02-13 08:52:57 -08:00
1 parent 0173c61fee
commit 3e23a3a860
41 files changed
+349 -223

No files matched your search

+2 -1
View File
@@ -16,6 +16,7 @@ from homeassistant.const import (
CONF_SSL,
CONF_USERNAME,
CONTENT_TYPE_JSON,
DATA_RATE_MEGABYTES_PER_SECOND,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
@@ -29,7 +30,7 @@ DEFAULT_PORT = 8000
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=15)
SENSOR_TYPES = {"speed": ["speed", "Speed", "MB/s"]}
SENSOR_TYPES = {"speed": ["speed", "Speed", DATA_RATE_MEGABYTES_PER_SECOND]}
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
{