Mercurial > code > home > repos > homeauto
comparison service/rdf_to_mqtt/rdf_to_mqtt.py @ 1541:d786df082a73
stop updating a graph (mqtt is our output)
Ignore-this: 764732cb27bde75d7425a4691a4faaf0
darcs-hash:e172f313c0671c368d3e60b2d5d92a75885e105d
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Mon, 10 Feb 2020 23:58:57 -0800 |
parents | 0c8aa432ec9d |
children | 71eec31da919 |
comparison
equal
deleted
inserted
replaced
1540:0c8aa432ec9d | 1541:d786df082a73 |
---|---|
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() |