Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
d88c6f7d7b
|
|||
926a71e6a8
|
|||
20a064dc1f
|
|||
8417454f5b
|
@ -142,7 +142,13 @@ def process_high_temp(box_name, context, local_context, payload):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def process_window(box_name, context, local_context, sub_key, payload):
|
def process_window(box_name, context, local_context, sub_key, payload):
|
||||||
local_context['window_state'][sub_key] = 'closed' if (payload.lower() in ('false', 'close', 'closed')) else 'open'
|
# default converter
|
||||||
|
converter = lambda x:x
|
||||||
|
for sk in context["boxes"][box_name]["windows"]:
|
||||||
|
if sk["label"] == sub_key:
|
||||||
|
converter = CONVERTERS["window_contact_input"][sk["converter"]]
|
||||||
|
break
|
||||||
|
local_context['window_state'][sub_key] = converter(payload)
|
||||||
_calculate_output_temperature(local_context)
|
_calculate_output_temperature(local_context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user