summaryrefslogtreecommitdiff
path: root/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/main.lua b/main.lua
index c06651f..3e47b13 100644
--- a/main.lua
+++ b/main.lua
@@ -46,11 +46,14 @@ function Wilson.make(cls, conf)
return self
end
-function Wilson.add_channels_for(self, pylon)
+function Wilson.add_channels_for(self, pylon, busses)
if not pylon.channels then return end
- for busname, bus in pairs(self.busses) do
+ busses = busses or self.busses
+ for busname, bus in pairs(busses) do
for _, channel in ipairs(bus) do
- if channel.pylon == pylon then
+ if channel.pylon == pylon
+ and not pylon.channels[channel.id]
+ then
pylon:add_channel(channel)
end end end end