Home Assistant Unofficial Reference 2024.12.1
const.py
Go to the documentation of this file.
1 """Freebox component constants."""
2 
3 from __future__ import annotations
4 
5 import enum
6 import socket
7 
8 from homeassistant.const import Platform
9 
10 DOMAIN = "freebox"
11 SERVICE_REBOOT = "reboot"
12 
13 APP_DESC = {
14  "app_id": "hass",
15  "app_name": "Home Assistant",
16  "app_version": "0.106",
17  "device_name": socket.gethostname(),
18 }
19 API_VERSION = "v6"
20 
21 PLATFORMS = [
22  Platform.ALARM_CONTROL_PANEL,
23  Platform.BINARY_SENSOR,
24  Platform.BUTTON,
25  Platform.CAMERA,
26  Platform.DEVICE_TRACKER,
27  Platform.SENSOR,
28  Platform.SWITCH,
29 ]
30 
31 DEFAULT_DEVICE_NAME = "Unknown device"
32 
33 # to store the cookie
34 STORAGE_KEY = DOMAIN
35 STORAGE_VERSION = 1
36 
37 
38 CONNECTION_SENSORS_KEYS = {"rate_down", "rate_up"}
39 
40 # Icons
41 DEVICE_ICONS = {
42  "freebox_delta": "mdi:television-guide",
43  "freebox_hd": "mdi:television-guide",
44  "freebox_mini": "mdi:television-guide",
45  "freebox_player": "mdi:television-guide",
46  "ip_camera": "mdi:cctv",
47  "ip_phone": "mdi:phone-voip",
48  "laptop": "mdi:laptop",
49  "multimedia_device": "mdi:play-network",
50  "nas": "mdi:nas",
51  "networking_device": "mdi:network",
52  "printer": "mdi:printer",
53  "router": "mdi:router-wireless",
54  "smartphone": "mdi:cellphone",
55  "tablet": "mdi:tablet",
56  "television": "mdi:television",
57  "vg_console": "mdi:gamepad-variant",
58  "workstation": "mdi:desktop-tower-monitor",
59 }
60 
61 ATTR_DETECTION = "detection"
62 
63 
64 # Home
65 class FreeboxHomeCategory(enum.StrEnum):
66  """Freebox Home categories."""
67 
68  ALARM = "alarm"
69  CAMERA = "camera"
70  DWS = "dws"
71  IOHOME = "iohome"
72  KFB = "kfb"
73  OPENER = "opener"
74  PIR = "pir"
75  RTS = "rts"
76 
77 
78 CATEGORY_TO_MODEL = {
79  FreeboxHomeCategory.PIR: "F-HAPIR01A",
80  FreeboxHomeCategory.CAMERA: "F-HACAM01A",
81  FreeboxHomeCategory.DWS: "F-HADWS01A",
82  FreeboxHomeCategory.KFB: "F-HAKFB01A",
83  FreeboxHomeCategory.ALARM: "F-MSEC07A",
84  FreeboxHomeCategory.RTS: "RTS",
85  FreeboxHomeCategory.IOHOME: "IOHome",
86 }
87 
88 HOME_COMPATIBLE_CATEGORIES = [
89  FreeboxHomeCategory.ALARM,
90  FreeboxHomeCategory.CAMERA,
91  FreeboxHomeCategory.DWS,
92  FreeboxHomeCategory.IOHOME,
93  FreeboxHomeCategory.KFB,
94  FreeboxHomeCategory.PIR,
95  FreeboxHomeCategory.RTS,
96 ]