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ä 2020-02-13 18:52:58 +02:00 committed by GitHub
parent 0173c61fee
commit 3e23a3a860
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 349 additions and 223 deletions

View file

@ -6,7 +6,7 @@ import re
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_SENSORS
from homeassistant.const import CONF_SENSORS, DATA_GIGABYTES
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
@ -26,8 +26,13 @@ SENSORS = {
SENSOR_NETWORK: ("signal strength", "Network", None, "mdi:access-point-network"),
SENSOR_SIGNAL: ("signal strength", "Signal Strength", "%", "mdi:signal"),
SENSOR_SMS_UNREAD: ("sms unread", "SMS unread", "", "mdi:message-text-outline"),
SENSOR_UPLOAD: ("traffic modem tx", "Sent", "GB", "mdi:cloud-upload"),
SENSOR_DOWNLOAD: ("traffic modem rx", "Received", "GB", "mdi:cloud-download"),
SENSOR_UPLOAD: ("traffic modem tx", "Sent", DATA_GIGABYTES, "mdi:cloud-upload"),
SENSOR_DOWNLOAD: (
"traffic modem rx",
"Received",
DATA_GIGABYTES,
"mdi:cloud-download",
),
}
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(