Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stechuhr-client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pandemic_Response
stechuhr-client
Commits
242067d0
Commit
242067d0
authored
4 years ago
by
David Huss
Browse files
Options
Downloads
Patches
Plain Diff
Fix off by one error in LED blinking
parent
c679bcc5
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
stechuhr_client/client.py
+2
-2
2 additions, 2 deletions
stechuhr_client/client.py
with
2 additions
and
2 deletions
stechuhr_client/client.py
+
2
−
2
View file @
242067d0
...
@@ -116,14 +116,14 @@ def set_led(ledstate, config):
...
@@ -116,14 +116,14 @@ def set_led(ledstate, config):
if
ledstate
in
[
"
success
"
,
"
ok
"
,
"
200
"
]:
if
ledstate
in
[
"
success
"
,
"
ok
"
,
"
200
"
]:
# Display the fitting LED color for the state at the given repetition
# Display the fitting LED color for the state at the given repetition
for
i
in
range
(
config
[
"
led
"
][
"
success_repetitions
"
]):
for
i
in
range
(
config
[
"
led
"
][
"
success_repetitions
"
]
+
1
):
LEDS
.
fill
(
repeat
(
config
[
"
led
"
][
"
success_color
"
],
i
))
LEDS
.
fill
(
repeat
(
config
[
"
led
"
][
"
success_color
"
],
i
))
time
.
sleep
(
repeat
(
config
[
"
led
"
][
"
success_on_time
"
],
i
))
time
.
sleep
(
repeat
(
config
[
"
led
"
][
"
success_on_time
"
],
i
))
LEDS
.
fill
((
0
,
0
,
0
))
LEDS
.
fill
((
0
,
0
,
0
))
time
.
sleep
(
repeat
(
config
[
"
led
"
][
"
success_off_time
"
],
i
))
time
.
sleep
(
repeat
(
config
[
"
led
"
][
"
success_off_time
"
],
i
))
elif
ledstate
in
[
"
failure
"
,
"
error
"
,
"
fail
"
,
"
404
"
]:
elif
ledstate
in
[
"
failure
"
,
"
error
"
,
"
fail
"
,
"
404
"
]:
# Display the fitting LED color for the state at the given repetition
# Display the fitting LED color for the state at the given repetition
for
i
in
range
(
config
[
"
led
"
][
"
failure_repetitions
"
]):
for
i
in
range
(
config
[
"
led
"
][
"
failure_repetitions
"
]
+
1
):
LEDS
.
fill
(
repeat
(
config
[
"
led
"
][
"
failure_color
"
],
i
))
LEDS
.
fill
(
repeat
(
config
[
"
led
"
][
"
failure_color
"
],
i
))
time
.
sleep
(
repeat
(
config
[
"
led
"
][
"
failure_on_time
"
],
i
))
time
.
sleep
(
repeat
(
config
[
"
led
"
][
"
failure_on_time
"
],
i
))
LEDS
.
fill
((
0
,
0
,
0
))
LEDS
.
fill
((
0
,
0
,
0
))
...
...
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