Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions components/EventColors.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ def __init__(self, role):
'icon': 'palette',
'inports': [
{ 'id': 'current', 'type': 'array'},
{ 'id': 'colors', 'type': 'object' },
{ 'id': 'palette', 'type': 'object' },
],
'outports': [
{ 'id': 'palette', 'type': 'object' },
{ 'id': 'mainhall', 'type': 'object' },
{ 'id': 'membersarea', 'type': 'object' },
],
}
self.palette = None
Expand All @@ -46,12 +47,13 @@ def process(self, inport, msg):
if inport == 'current':
self.current_events = msg.data
if self.palette:
self.send('palette', handleEvents(msg.data, self.palette))
self.send('mainhall', handleEvents(msg.data, self.palette))
self.ack(msg)
return
if inport == 'colors':
if inport == 'palette':
self.palette = msg.data
self.send('palette', handleEvents(self.current_events, msg.data))
self.send('mainhall', handleEvents(self.current_events, msg.data))
self.send('membersarea', handleEvents(self.current_events, msg.data))
self.ack(msg)

if __name__ == '__main__':
Expand Down
14 changes: 7 additions & 7 deletions graphs/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@
{
"src": {
"process": "eventcolors",
"port": "palette"
"port": "mainhall"
},
"tgt": {
"process": "bigswitch",
Expand All @@ -792,8 +792,8 @@
},
{
"src": {
"process": "farbgeber",
"port": "palette"
"process": "eventcolors",
"port": "membersarea"
},
"tgt": {
"process": "pioneer",
Expand All @@ -817,13 +817,13 @@
},
"tgt": {
"process": "eventcolors",
"port": "colors"
"port": "palette"
}
},
{
"src": {
"process": "eventcolors",
"port": "palette"
"port": "mainhall"
},
"tgt": {
"process": "farbdmx",
Expand All @@ -832,8 +832,8 @@
},
{
"src": {
"process": "farbgeber",
"port": "palette"
"process": "eventcolors",
"port": "membersarea"
},
"tgt": {
"process": "farbhue",
Expand Down
12 changes: 6 additions & 6 deletions spec/EventColors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ fixture:
type: 'fbp'
data: |
INPORT=Events.CURRENT:CURRENT
INPORT=Events.COLORS:COLORS
OUTPORT=Events.PALETTE:PALETTE
INPORT=Events.PALETTE:PALETTE
OUTPORT=Events.MAINHALL:MAINHALL
Events(c-flo/EventColors)
cases:
-
name: 'when there is no event'
assertion: 'should return farbgeber palette'
inputs:
current: []
colors:
palette:
b: [0, 0, 0]
expect:
palette:
mainhall:
-
equals:
b: [0, 0, 0]
Expand All @@ -27,10 +27,10 @@ cases:
current:
-
summary: cryptoparty
colors:
palette:
b: [0, 0, 0]
expect:
palette:
mainhall:
-
equals:
b: [255, 0, 152]
Expand Down