Mercurial > code > home > repos > homeauto
comparison service/arduinoNode/devices.py @ 172:715c1c42185e
obey ActiveLowOutput correctly
Ignore-this: d8423b272f210a6fbbd9b35772bf7065
author | drewp@bigasterisk.com |
---|---|
date | Fri, 17 Apr 2015 01:03:52 -0700 |
parents | 376599552a4c |
children | f81c4d3d774b |
comparison
equal
deleted
inserted
replaced
171:4d2df276baae | 172:715c1c42185e |
---|---|
251 | 251 |
252 def sendOutput(self, statements, write, read): | 252 def sendOutput(self, statements, write, read): |
253 assert len(statements) == 1 | 253 assert len(statements) == 1 |
254 assert statements[0][:2] == (self.uri, ROOM['brightness']) | 254 assert statements[0][:2] == (self.uri, ROOM['brightness']) |
255 value = float(statements[0][2]) | 255 value = float(statements[0][2]) |
256 if (self.uri, RDF.type, ROOM['ActiveLowOutput']): | 256 if (self.uri, RDF.type, ROOM['ActiveLowOutput']) in self.graph: |
257 value = 1 - value | 257 value = 1 - value |
258 write(byteFromFloat(value)) | 258 write(byteFromFloat(value)) |
259 | 259 |
260 def generateActionCode(self): | 260 def generateActionCode(self): |
261 return r''' | 261 return r''' |