Dropped support for gate LEDs.
This commit is contained in:
parent
98026d109e
commit
1e5711b7c2
1 changed files with 3 additions and 18 deletions
19
c4ctrl.py
19
c4ctrl.py
|
@ -42,8 +42,7 @@ from random import choice # for client_id generation.
|
||||||
class C4Interface: # {{{1
|
class C4Interface: # {{{1
|
||||||
""" Interaction with AutoC4, the C4 home automation system. """
|
""" Interaction with AutoC4, the C4 home automation system. """
|
||||||
|
|
||||||
#broker = "autoc4.labor.koeln.ccc.de"
|
broker = "autoc4.labor.koeln.ccc.de"
|
||||||
broker = "172.23.23.110"
|
|
||||||
port = 1883
|
port = 1883
|
||||||
qos = 0
|
qos = 0
|
||||||
retain = True
|
retain = True
|
||||||
|
@ -527,13 +526,6 @@ 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. """
|
||||||
|
|
||||||
|
@ -766,8 +758,7 @@ class Wohnzimmer(C4Room): # {{{1
|
||||||
Dmx("dmx/wohnzimmer/spuele2"),
|
Dmx("dmx/wohnzimmer/spuele2"),
|
||||||
Dmx("dmx/wohnzimmer/tresen"),
|
Dmx("dmx/wohnzimmer/tresen"),
|
||||||
Dmx("dmx/wohnzimmer/tresen2"),
|
Dmx("dmx/wohnzimmer/tresen2"),
|
||||||
Dmx("dmx/wohnzimmer/chaosknoten"),
|
Dmx("dmx/wohnzimmer/chaosknoten")
|
||||||
Rgb4("rgb/bell")
|
|
||||||
)
|
)
|
||||||
# }}}1
|
# }}}1
|
||||||
|
|
||||||
|
@ -1087,17 +1078,11 @@ 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)
|
||||||
# Comment out master, as it would override everything else.
|
# Comment out master, as it would override everything else.
|
||||||
if self._topic_is_master(r.topic):
|
if self._topic_is_master(r.topic):
|
||||||
fd.write("#{} = {}\n".format(topic, color))
|
fd.write("#{} = {}\n".format(topic, color))
|
||||||
# Also comment out rgb/bell, as it should not usually be set manually.
|
|
||||||
elif r.topic == "rgb/bell":
|
|
||||||
fd.write("# Set automatically when club status changes.\n#{} = {}\n".format(topic, color))
|
|
||||||
else:
|
else:
|
||||||
fd.write("{} = {}\n".format(topic, color))
|
fd.write("{} = {}\n".format(topic, color))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue