diff options
Diffstat (limited to 'main.lua')
| -rw-r--r-- | main.lua | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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 |
