Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CS Fancy Clock
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
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
TheJoeCoder
CS Fancy Clock
Commits
d3bc8224
Verified
Commit
d3bc8224
authored
10 months ago
by
TheJoeCoder
Browse files
Options
Downloads
Patches
Plain Diff
Add env toggle for LED state
parent
6c112ec0
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
absled/dummy.py
+5
-1
5 additions, 1 deletion
absled/dummy.py
with
5 additions
and
1 deletion
absled/dummy.py
+
5
−
1
View file @
d3bc8224
import
os
from
absled
import
ILedString
from
absled
import
ILedString
...
@@ -7,6 +9,7 @@ class DummyLedString(ILedString):
...
@@ -7,6 +9,7 @@ class DummyLedString(ILedString):
self
.
location
=
location
self
.
location
=
location
self
.
leds
=
[(
0
,
0
,
0
)]
*
length
self
.
leds
=
[(
0
,
0
,
0
)]
*
length
self
.
real_leds
=
[(
0
,
0
,
0
)]
*
length
self
.
real_leds
=
[(
0
,
0
,
0
)]
*
length
self
.
log_led_state
=
os
.
environ
.
get
(
"
LOG_LED_STATE
"
,
0
)
==
1
def
set_led
(
self
,
color
:
tuple
[
int
,
int
,
int
],
index
:
int
):
def
set_led
(
self
,
color
:
tuple
[
int
,
int
,
int
],
index
:
int
):
self
.
leds
[
index
]
=
color
self
.
leds
[
index
]
=
color
...
@@ -26,4 +29,5 @@ class DummyLedString(ILedString):
...
@@ -26,4 +29,5 @@ class DummyLedString(ILedString):
def
show
(
self
):
def
show
(
self
):
self
.
real_leds
=
self
.
leds
.
copy
()
self
.
real_leds
=
self
.
leds
.
copy
()
if
self
.
log_led_state
:
print
(
"
LED State:
"
,
self
.
leds
)
print
(
"
LED State:
"
,
self
.
leds
)
\ No newline at end of file
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