diff options
| author | rebecca <ubq323@ubq323.website> | 2026-09-25 17:00:01 +0100 |
|---|---|---|
| committer | rebecca <ubq323@ubq323.website> | 2026-09-25 17:00:50 +0100 |
| commit | dbf2436f133ffeb6ac08f1b55d7f9c60edd4b683 (patch) | |
| tree | 231c50a1703e31ee9231952d8ab3b1bb2e1a8896 | |
| parent | 28a876fa341174e8d17640fc215854328ce65b42 (diff) | |
add optional busses param to add_channels_for; look at pylon.channels
| -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 |
