comparison service/rdf_to_mqtt/rdf_to_mqtt.py @ 1702:ac1ae0c21bb0

formatting
author drewp@bigasterisk.com
date Sat, 23 Oct 2021 13:14:07 -0700
parents 6b80a6c58907
children 80b01d548b9c
comparison
equal deleted inserted replaced
1701:33747dcf57ea 1702:ac1ae0c21bb0
130 msg = 'ON' 130 msg = 'ON'
131 self._publish(topic=attrs['root'], message=msg) 131 self._publish(topic=attrs['root'], message=msg)
132 132
133 def _publishRgbw(self, attrs, brightness): 133 def _publishRgbw(self, attrs, brightness):
134 for chan, scale in [('w1', 1), ('r', 1), ('g', .8), ('b', .8)]: 134 for chan, scale in [('w1', 1), ('r', 1), ('g', .8), ('b', .8)]:
135 self._publish(topic=f"{attrs['root']}/light/kit_{chan}/command", 135 self._publish(topic=f"{attrs['root']}/light/kit_{chan}/command", messageJson={'state': 'ON', 'brightness': int(brightness * 255)})
136 messageJson={
137 'state': 'ON',
138 'brightness': int(brightness * 255)
139 })
140 136
141 def _publishFrontScreenText(self, stmt): 137 def _publishFrontScreenText(self, stmt):
142 ignored = True 138 ignored = True
143 for line in ['line1', 'line2', 'line3', 'line4']: 139 for line in ['line1', 'line2', 'line3', 'line4']:
144 if stmt[1] == ROOM[line]: 140 if stmt[1] == ROOM[line]: