fix
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful

This commit is contained in:
2024-11-18 14:54:53 +01:00
parent edb739764a
commit d314ef37e4
3 changed files with 11 additions and 8 deletions

View File

@ -76,8 +76,9 @@ class Box:
case [ primary_key ] if primary_key == 'high_temp':
self.context.high_temperature = payload
case [ primary_key ] if primary_key == 'cmd':
if payload in ('high', 'low', 'off'):
self.context.mode = payload
p = payload.lower()
if p in ('high', 'low', 'off'):
self.context.mode = p
else:
raise Exception(f"Invalid cmd '{payload}'")
case [ primary_key ] if primary_key == 'overwrite_window':

View File

@ -1,3 +1,5 @@
import json
CONVERTERS = {
"target_temperature_output": {
"max": lambda x: x,