This PR adds the ability to set the edge colors on the VMBEL1, VMBEL2, VMBEL4, VMBELO modules. I only own a VMBELO module, so I could only test against that one.
The function parameters mirror the available configuration options ins VelbusLink:
I used the following code to test:
velbus = Velbus(connect_str)
await velbus.connect()
# get edge lit channel
edge_lit_chan : EdgeLit = None
for key, chan in (velbus.get_module(128).get_channels()).items():
if isinstance(chan, EdgeLit):
edge_lit_chan = chan
break
print(edge_lit_chan)
from velbusaio.messages.edge_set_color import CustomColorPriority
await edge_lit_chan.set_color(20, priority=CustomColorPriority.HIGH_PRIORITY, blinking=True)
await asyncio.sleep(5)
await edge_lit_chan.reset_color()
await asyncio.sleep(5)
Note that I didn't use commandRegistry.get_command(0xD4, ... to retrieve the message class, as both EdgeSetCustomColor and SetEdgeColorMessage use the same 0xD4 command code. I guess that the module itself differentiates between both by looking at the length of the message? 🤔
This PR adds the ability to set the edge colors on the VMBEL1, VMBEL2, VMBEL4, VMBELO modules. I only own a VMBELO module, so I could only test against that one.
The function parameters mirror the available configuration options ins VelbusLink:
I used the following code to test:
Note that I didn't use
commandRegistry.get_command(0xD4, ...
to retrieve the message class, as bothEdgeSetCustomColor
andSetEdgeColorMessage
use the same0xD4
command code. I guess that the module itself differentiates between both by looking at the length of the message? 🤔