File tree Expand file tree Collapse file tree 3 files changed +25
-18
lines changed Expand file tree Collapse file tree 3 files changed +25
-18
lines changed Original file line number Diff line number Diff line change @@ -50,10 +50,10 @@ class Leds(object):
5050 blue_one = Led (name = 'brickpi1:blue:ev3dev' )
5151 blue_two = Led (name = 'brickpi2:blue:ev3dev' )
5252
53- BLUE_ONE = (blue_one , )
54- BLUE_TWO = (blue_two , )
53+ ONE = ( blue_one )
54+ TWO = ( blue_two )
5555
56- BLUE = (1 , )
56+ BLUE = ( 1 )
5757
5858 @staticmethod
5959 def set_color (group , color , pct = 1 ):
Original file line number Diff line number Diff line change @@ -52,14 +52,14 @@ class Leds(object):
5252 green_left = Led (name = 'ev3-left1:green:ev3dev' )
5353 green_right = Led (name = 'ev3-right1:green:ev3dev' )
5454
55- LEFT = (red_left , green_left , )
56- RIGHT = (red_right , green_right , )
57-
58- RED = (1 , 0 , )
59- GREEN = (0 , 1 , )
60- AMBER = (1 , 1 , )
61- ORANGE = (1 , 0.5 , )
62- YELLOW = (0.5 , 1 , )
55+ LEFT = ( red_left , green_left )
56+ RIGHT = ( red_right , green_right )
57+
58+ RED = ( 1 , 0 )
59+ GREEN = ( 0 , 1 )
60+ AMBER = ( 1 , 1 )
61+ ORANGE = ( 1 , 0.5 )
62+ YELLOW = ( 0.5 , 1 )
6363
6464 @staticmethod
6565 def set_color (group , color , pct = 1 ):
Original file line number Diff line number Diff line change 33 {{instanceName }} = Led(name='{{instance .systemName }}'){%
44endfor %}
55{% for group in currentClass .groups %}{%
6- assign groupName = group .name | upcase | underscore_spaces %}
7- {{ groupName }} = ({% for e in group .entries %}{%
8- assign instance = e | downcase | underscore_spaces
9- %}{{ instance }}, {%
10- endfor %}){%
6+ assign groupName = group .name | upcase | underscore_spaces %}{%
7+ assign ledNames = '' %}{%
8+ for name in group .entries %}{%
9+ capture ledNames %}{{ ledNames }}, {{ name | downcase | underscore_spaces }}{%
10+ endcapture %}{%
11+ endfor %}
12+ {{ groupName }} = ( {{ ledNames | remove_first: ', ' }} ){%
1113endfor %}
1214{% for color in currentClass .colors %}{%
13- assign colorName = color .name | upcase | underscore_spaces %}
14- {{ colorName }} = ({% for v in color .value %}{{ v }}, {%endfor %}){%
15+ assign colorName = color .name | upcase | underscore_spaces %}{%
16+ assign mixRatio = '' %}{%
17+ for mix in color .mix %}{%
18+ capture mixRatio %}{{ mixRatio }}, {{ mix .value }}{%
19+ endcapture %}{%
20+ endfor %}
21+ {{ colorName }} = ( {{ mixRatio | remove_first: ', ' }} ){%
1522endfor %}
1623
1724 @staticmethod
You can’t perform that action at this time.
0 commit comments