Add and use time related constants (#32065)
* Add and use time related constants * Sort time constants and reuse them in data rate constants * Fix greeneyemonitor import * Fix greeneyemonitor import V2 * Fix failing here_travel_time test * Add TIME_MONTHS and TIME_YEARS * Use TIME_MINUTES in opentherm_gw and isy994 * Add and use TIME_MILLISECONDS * Change inconsistent ones * Add TIME_MICROSECONDS and TIME_WEEKS * Use constants in apcupsd and travisci * Fix import error in upnp sensor.py * Fix isy994 sensor.py using TIME_YEARS * Fix dyson tests * Use TIME_SECONDS in more places * Use TIME_DAYS in google wifi
This commit is contained in:
parent
8dd80e0e3c
commit
a85808e325
81 changed files with 480 additions and 287 deletions
|
@ -22,6 +22,7 @@ from homeassistant.const import (
|
|||
DEVICE_CLASS_TEMPERATURE,
|
||||
PRESSURE_HPA,
|
||||
TEMP_CELSIUS,
|
||||
TIME_SECONDS,
|
||||
)
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
@ -41,8 +42,8 @@ SENSOR_TYPES = {
|
|||
"symbol": ["Symbol", None, None],
|
||||
"precipitation": ["Precipitation", "mm", None],
|
||||
"temperature": ["Temperature", TEMP_CELSIUS, DEVICE_CLASS_TEMPERATURE],
|
||||
"windSpeed": ["Wind speed", "m/s", None],
|
||||
"windGust": ["Wind gust", "m/s", None],
|
||||
"windSpeed": ["Wind speed", f"m/{TIME_SECONDS}", None],
|
||||
"windGust": ["Wind gust", f"m/{TIME_SECONDS}", None],
|
||||
"pressure": ["Pressure", PRESSURE_HPA, DEVICE_CLASS_PRESSURE],
|
||||
"windDirection": ["Wind direction", "°", None],
|
||||
"humidity": ["Humidity", "%", DEVICE_CLASS_HUMIDITY],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue