Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kalle Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
Teckids
Projekt Hack-n-Fun
Kalle Firmware
Commits
19814a24
Commit
19814a24
authored
2 weeks ago
by
Martin Winter
Browse files
Options
Downloads
Patches
Plain Diff
fix problem when mqtt server sends effect msg with empty key
parent
55f622f7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.py
+3
-1
3 additions, 1 deletion
main.py
wled.py
+2
-2
2 additions, 2 deletions
wled.py
with
5 additions
and
3 deletions
main.py
+
3
−
1
View file @
19814a24
...
...
@@ -67,7 +67,9 @@ def react(topic, msg, retained):
)
wled
.
set_color
(
led_number
,
msg
[
0
],
msg
[
1
],
msg
[
2
],
flush
=
True
)
elif
re
.
match
(
fr
"
{
config
.
mqtt_topic
}
/effects
"
,
topic
):
if
msg
[
0
]
in
config
.
functions
:
if
not
msg
:
pass
elif
msg
[
0
]
in
config
.
functions
:
config
.
functions
[
msg
[
0
]][
"
function
"
]()
async
def
main
(
mqtt
):
...
...
This diff is collapsed.
Click to expand it.
wled.py
+
2
−
2
View file @
19814a24
...
...
@@ -74,7 +74,7 @@ def set_color(led_id: int, red: int, green: int, blue: int, white: int = 0, flus
if
flush
:
leds
.
write
()
def
party
(
time_in_seconds
:
int
):
def
party
(
time_in_seconds
:
int
=
10
):
# Save colors
_save_state
()
...
...
@@ -90,7 +90,7 @@ def party(time_in_seconds: int):
# Recover old colors
_recover_state
()
def
rainbow
(
time_in_seconds
:
int
):
def
rainbow
(
time_in_seconds
:
int
=
10
):
# Save colors
_save_state
()
...
...
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