Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Esp32 Dimmer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cpresser
Esp32 Dimmer
Commits
8099dbf2
Commit
8099dbf2
authored
2 years ago
by
Carsten Presser
Browse files
Options
Downloads
Patches
Plain Diff
Remove obsolete white_value from json-light
parent
c31b2036
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
software/main.py
+7
-6
7 additions, 6 deletions
software/main.py
with
7 additions
and
6 deletions
software/main.py
+
7
−
6
View file @
8099dbf2
...
...
@@ -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
'
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment