Mercurial > code > home > repos > homeauto
comparison service/rdf_to_mqtt/rdf_to_mqtt.py @ 741:1135680fba5a
stop updating a graph (mqtt is our output)
Ignore-this: 764732cb27bde75d7425a4691a4faaf0
author | drewp@bigasterisk.com |
---|---|
date | Mon, 10 Feb 2020 23:58:57 -0800 |
parents | 1f8abec7f687 |
children | 78f699077ff5 |
comparison
equal
deleted
inserted
replaced
740:1f8abec7f687 | 741:1135680fba5a |
---|---|
86 | 86 |
87 if attrs.get('values', '') == 'binary': | 87 if attrs.get('values', '') == 'binary': |
88 self._publishOnOff(attrs, brightness) | 88 self._publishOnOff(attrs, brightness) |
89 else: | 89 else: |
90 self._publishRgbw(attrs, brightness) | 90 self._publishRgbw(attrs, brightness) |
91 # try to stop saving this; let the device be the master usually | |
92 self.settings.masterGraph.patchObject( | |
93 attrs['ctx'], | |
94 stmt[0], stmt[1], stmt[2]) | |
95 ignored = False | 91 ignored = False |
96 if ignored: | 92 if ignored: |
97 log.warn("ignoring %s", stmt) | 93 log.warn("ignoring %s", stmt) |
98 | 94 |
99 def _publishOnOff(self, attrs, brightness): | 95 def _publishOnOff(self, attrs, brightness): |
149 {"path": ".", "default_filename": "index.html"}), | 145 {"path": ".", "default_filename": "index.html"}), |
150 (r'/output', OutputPage), | 146 (r'/output', OutputPage), |
151 ], mqtt=mqtt, debug=arg['-v']), interface='::') | 147 ], mqtt=mqtt, debug=arg['-v']), interface='::') |
152 log.warn('serving on %s', port) | 148 log.warn('serving on %s', port) |
153 | 149 |
154 for dev, attrs in devs.items(): | |
155 masterGraph.patchObject(attrs['ctx'], | |
156 dev, ROOM['brightness'], Literal(0.0)) | |
157 | |
158 reactor.run() | 150 reactor.run() |