Skip to content
Snippets Groups Projects
Commit 8099dbf2 authored by Carsten Presser's avatar Carsten Presser
Browse files

Remove obsolete white_value from json-light

parent c31b2036
No related branches found
No related tags found
No related merge requests found
......@@ -140,15 +140,16 @@ class MQTT_Light():
"name": "ESP32 Dimmer"
},
"schema": "json",
"rgb": True,
"white_value": True,
"color_mode": True,
"supported_color_modes": "rgbw",
"brightness": True,
}))
self.json_state = {
"white_value": 0,
"brightness": 0,
"color_mode": "rgbw",
"state": "OFF",
"color": {
"w": 0,
"r": 0,
"b": 0,
"g": 0
......@@ -186,8 +187,6 @@ class MQTT_Light():
self.json_state['transition'] = pl['transition']
else:
self.json_state['transition'] = None
if "white_value" in pl:
self.json_state['white_value'] = pl['white_value']
if "brightness" in pl:
self.json_state['brightness'] = pl['brightness']
if "color" in pl:
......@@ -197,10 +196,12 @@ class MQTT_Light():
self.json_state['color']['b'] = pl['color']['b']
if "g" in pl['color']:
self.json_state['color']['g'] = pl['color']['g']
if "w" in pl['color']:
self.json_state['color']['w'] = pl['color']['w']
if "state" in pl:
if pl['state'] == 'ON':
self.json_state['state'] = 'ON'
self.set_cb(chan, 0, self.json_state['white_value'], self.json_state['brightness'])
self.set_cb(chan, 0, self.json_state['color']['w'], self.json_state['brightness'])
self.set_cb(chan, 1, self.json_state['color']['g'], self.json_state['brightness'])
self.set_cb(chan, 2, self.json_state['color']['b'], self.json_state['brightness'])
self.set_cb(chan, 3, self.json_state['color']['r'], self.json_state['brightness'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment