Dropped support for gate LEDs.

This commit is contained in:
Shy 2024-03-20 12:14:11 +01:00
parent 98026d109e
commit 1e5711b7c2

View file

@ -42,8 +42,7 @@ from random import choice # for client_id generation.
class C4Interface: # {{{1
""" Interaction with AutoC4, the C4 home automation system. """
#broker = "autoc4.labor.koeln.ccc.de"
broker = "172.23.23.110"
broker = "autoc4.labor.koeln.ccc.de"
port = 1883
qos = 0
retain = True
@ -527,13 +526,6 @@ class Dmx7(Dmx): # {{{1
template = "000000000000ff"
# }}}1
class Rgb4(Dmx): # {{{1
""" Abstraction of the 4 LED doorbell hardware. """
# 4 times 3 bytes (RGB).
template = "00ff0000ff0000ff0000ff00"
# }}}1
class C4Room: # {{{1
""" Methods of rooms in the club. """
@ -766,8 +758,7 @@ class Wohnzimmer(C4Room): # {{{1
Dmx("dmx/wohnzimmer/spuele2"),
Dmx("dmx/wohnzimmer/tresen"),
Dmx("dmx/wohnzimmer/tresen2"),
Dmx("dmx/wohnzimmer/chaosknoten"),
Rgb4("rgb/bell")
Dmx("dmx/wohnzimmer/chaosknoten")
)
# }}}1
@ -1087,17 +1078,11 @@ is reserved. Please choose a different one.".format(name))
# Format payload more nicely.
color = light.color
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)
# Comment out master, as it would override everything else.
if self._topic_is_master(r.topic):
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:
fd.write("{} = {}\n".format(topic, color))