Home Assistant Unofficial Reference 2024.12.1
const.py
Go to the documentation of this file.
1 """The lookin integration constants."""
2 
3 from __future__ import annotations
4 
5 from datetime import timedelta
6 from typing import Final
7 
8 from homeassistant.const import Platform
9 
10 MODEL_NAMES: Final = ["LOOKin Remote", "LOOKin Remote", "LOOKin Remote2"]
11 
12 DOMAIN: Final = "lookin"
13 PLATFORMS: Final = [
14  Platform.CLIMATE,
15  Platform.LIGHT,
16  Platform.MEDIA_PLAYER,
17  Platform.SENSOR,
18 ]
19 
20 
21 TYPE_TO_PLATFORM = {
22  "01": Platform.MEDIA_PLAYER,
23  "02": Platform.MEDIA_PLAYER,
24  "03": Platform.LIGHT,
25  "EF": Platform.CLIMATE,
26 }
27 
28 NEVER_TIME = -120.0 # Time that will never match time.monotonic()
29 ACTIVE_UPDATES_INTERVAL = 4 # Consider active for 4x the update interval
30 METEO_UPDATE_INTERVAL = timedelta(minutes=5)
31 REMOTE_UPDATE_INTERVAL = timedelta(seconds=60)
32 POLLING_FALLBACK_SECONDS = (
33  max(REMOTE_UPDATE_INTERVAL, METEO_UPDATE_INTERVAL).total_seconds()
34  * ACTIVE_UPDATES_INTERVAL
35 )