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
|
@ -8,6 +8,7 @@ from lyft_rides.errors import APIError
|
|||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import TIME_MINUTES
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.util import Throttle
|
||||
|
@ -88,7 +89,7 @@ class LyftSensor(Entity):
|
|||
if "lyft" not in self._name.lower():
|
||||
self._name = f"Lyft{self._name}"
|
||||
if self._sensortype == "time":
|
||||
self._unit_of_measurement = "min"
|
||||
self._unit_of_measurement = TIME_MINUTES
|
||||
elif self._sensortype == "price":
|
||||
estimate = self._product["estimate"]
|
||||
if estimate is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue