-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathconst.py
138 lines (119 loc) · 2.89 KB
/
const.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
"""Constants used in Bosch thermostat."""
BS = 16
MAGIC = bytearray.fromhex(
"867845e97c4e29dce522b9a7d3a3e07b152bffadddbed7f5ffd842e9895ad1e4")
GET = "get"
SUBMIT = "submit"
NAME = "name"
PATH = "path"
ID = "id"
REFS = "refs"
REFERENCES = "references"
HA_STATES = "hastates"
UUID = "uuid"
# PATHS = "paths"
GATEWAY = "gateway"
HC = "hc"
DHW = "dhw"
SC = "sc"
SENSORS = "sensors"
SENSOR = "sensor"
DICT = "dict"
MODELS = "models"
# PRESETS = "presets"
TEMP = "temp"
DATE = "dateTime"
""" New refs scheme. """
OPERATION_MODE = "operation_mode"
STATUS = "status"
AUTO = "auto"
MANUAL = "manual"
OFF = "off"
ON = "on"
MAX = "max"
MIN = "min"
MAX_VALUE = "maxValue"
MIN_VALUE = "minValue"
UNITS = "units"
VALUE = "value"
VALUES = "values"
ALLOWED_VALUES = "allowedValues"
STATE = "state"
CURRENT_TEMP = "current_temp"
CURRENT_SETPOINT = "currentSetpoint"
ACTIVE_PROGRAM = "activeProgram"
DAYOFWEEK = "dayOfWeek"
MODE = "mode"
START = "start"
STOP = "stop"
SETPOINT = "setpoint"
TIME = "time"
OPEN = "open"
SHORT = "short"
INVALID = "invalid"
CIRCUITS = "circuits"
ROOT_PATHS = ["/dhwCircuits", "/gateway", "/heatingCircuits",
"/heatSources", "/notifications", "/system", "/solarCircuits"]
""" Section of gateway info consts. """
FIRMWARE_VERSION = "versionFirmware"
TYPE = "type"
URI = "uri"
REGULAR = "regular"
RESULT = "result" # to not mismarch with value
SYSTEM_BRAND = "brand"
SYSTEM_TYPE = "systemType"
SYSTEM_INFO = "systemInfo"
SYSTEM_BUS = "systemBus"
CAN = "CAN"
EMS = "EMS"
DEFAULT = "default"
USER_AGENT = "User-agent"
CONNECTION = "Connection"
TELEHEATER = "TeleHeater"
KEEP_ALIVE = "keep-alive"
CONENT_TYPE = "Content-Type"
APP_JSON = "application/json"
HTTP_HEADER = {
USER_AGENT: TELEHEATER,
CONNECTION: KEEP_ALIVE,
CONENT_TYPE: APP_JSON
}
TIMEOUT = 10
HEATING_CIRCUITS = "heatingCircuits"
DHW_CIRCUITS = "dhwCircuits"
SOLAR_CIRCUITS = "solarCircuits"
CIRCUIT_TYPES = {
HC: HEATING_CIRCUITS,
DHW: DHW_CIRCUITS,
SC: SOLAR_CIRCUITS
}
MODE_TO_SETPOINT = "mode_to_setpoint"
READ = "read"
WRITE = "write"
MAX_REF = "max_ref"
MIN_REF = "min_ref"
HA_NAME = "haname"
BOSCH_NAME = "boschname"
RC300 = "RC300"
# SCHEDULE
SETPOINT_PROP = "setpointProperty"
SWITCH_POINTS = "switchPoints"
SWITCHPROGRAM = "switchprogram"
MIDNIGHT = 1440
DAYS = {
"Mo": "monday",
"Tu": "tuesday",
"We": "wednesday",
"Th": "thursday",
"Fr": "friday",
"Sa": "saturday",
"Su": "sunday",
}
DAYS_INT = [k for k in DAYS.keys()]
DAYS_INDEXES = [k for k in DAYS.values()]
DAYS_INV = [{v: k for k, v in DAYS.items()}]
SENSORS_LIST = ["outdoor_t1", "hotWater_t2", "supply_t1_setpoint", "supply_t1",
"return", "healthStatus", "actualPower", "actualModulation",
"CHpumpModulation"]
DEFAULT_MIN_TEMP = 0
DEFAULT_MAX_TEMP = 100