Added rgb/bell.
This commit is contained in:
parent
20f74e2711
commit
d203c540a9
1 changed files with 17 additions and 6 deletions
21
c4ctrl.py
21
c4ctrl.py
|
@ -526,6 +526,13 @@ class Dmx7(Dmx): # {{{1
|
||||||
template = "000000000000ff"
|
template = "000000000000ff"
|
||||||
# }}}1
|
# }}}1
|
||||||
|
|
||||||
|
class Rgb4(Dmx): # {{{1
|
||||||
|
""" Abstraction of the 4 LED doorbell hardware. """
|
||||||
|
|
||||||
|
# 4 times 3 bytes (RGB).
|
||||||
|
template = "00ff0000ff0000ff0000ff00"
|
||||||
|
# }}}1
|
||||||
|
|
||||||
class C4Room: # {{{1
|
class C4Room: # {{{1
|
||||||
""" Methods of rooms in the club. """
|
""" Methods of rooms in the club. """
|
||||||
|
|
||||||
|
@ -754,11 +761,12 @@ class Wohnzimmer(C4Room): # {{{1
|
||||||
Dmx7("dmx/wohnzimmer/mitte3"),
|
Dmx7("dmx/wohnzimmer/mitte3"),
|
||||||
Dmx7("dmx/wohnzimmer/gang"),
|
Dmx7("dmx/wohnzimmer/gang"),
|
||||||
Dmx7("dmx/wohnzimmer/baellebad"),
|
Dmx7("dmx/wohnzimmer/baellebad"),
|
||||||
Dmx7("dmx/wohnzimmer/spuele1"),
|
Dmx("dmx/wohnzimmer/spuele1"),
|
||||||
Dmx7("dmx/wohnzimmer/spuele2"),
|
Dmx("dmx/wohnzimmer/spuele2"),
|
||||||
Dmx7("dmx/wohnzimmer/tresen"),
|
Dmx("dmx/wohnzimmer/tresen"),
|
||||||
Dmx7("dmx/wohnzimmer/tresen2"),
|
Dmx("dmx/wohnzimmer/tresen2"),
|
||||||
Dmx7("dmx/wohnzimmer/chaosknoten")
|
Dmx("dmx/wohnzimmer/chaosknoten"),
|
||||||
|
Rgb4("rgb/bell")
|
||||||
)
|
)
|
||||||
# }}}1
|
# }}}1
|
||||||
|
|
||||||
|
@ -1078,6 +1086,9 @@ is reserved. Please choose a different one.".format(name))
|
||||||
# Format payload more nicely.
|
# Format payload more nicely.
|
||||||
color = light.color
|
color = light.color
|
||||||
if len(color) > 6:
|
if len(color) > 6:
|
||||||
|
if type(light) == Rgb4:
|
||||||
|
color = color[:6] + ' ' + color[6:12] + ' ' + color[12:18] + ' ' + color[18:24]
|
||||||
|
else:
|
||||||
color = color[:6] + ' ' + color[6:]
|
color = color[:6] + ' ' + color[6:]
|
||||||
topic = light.topic.ljust(max_topic_len)
|
topic = light.topic.ljust(max_topic_len)
|
||||||
# Out comment master, as it would override everything else.
|
# Out comment master, as it would override everything else.
|
||||||
|
|
Loading…
Reference in a new issue