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:
1 parent
8dd80e0e3c
commit
a85808e325
81 files changed
+480
-287
No files matched your search
@@ -4,6 +4,7 @@ import logging
|
||||
from typing import Any, Dict
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import TIME_MILLISECONDS
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
|
||||
from . import MinecraftServer, MinecraftServerEntity
|
||||
@@ -20,7 +21,6 @@ from .const import (
|
||||
NAME_PLAYERS_ONLINE,
|
||||
NAME_PROTOCOL_VERSION,
|
||||
NAME_VERSION,
|
||||
UNIT_LATENCY_TIME,
|
||||
UNIT_PLAYERS_MAX,
|
||||
UNIT_PLAYERS_ONLINE,
|
||||
UNIT_PROTOCOL_VERSION,
|
||||
@@ -121,7 +121,7 @@ class MinecraftServerLatencyTimeSensor(MinecraftServerSensorEntity):
|
||||
server=server,
|
||||
type_name=NAME_LATENCY_TIME,
|
||||
icon=ICON_LATENCY_TIME,
|
||||
unit=UNIT_LATENCY_TIME,
|
||||
unit=TIME_MILLISECONDS,
|
||||
)
|
||||
|
||||
async def async_update(self) -> None:
|
||||
|
||||
Reference in new issue
Block a user