Mercurial > code > home > repos > homeauto
diff service/bedroomArduino/bedroomArduino.py @ 922:e4069a2cfcc8
bedroomarduino updates
Ignore-this: eeb3e527e652601b04ddd1d18f0f15f3
darcs-hash:20130922073020-312f9-13483a3790ad5fbbe75ad2345760993f4c5c1b92
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Sun, 22 Sep 2013 00:30:20 -0700 |
parents | 1f69e77411ba |
children |
line wrap: on
line diff
--- a/service/bedroomArduino/bedroomArduino.py Thu Sep 19 23:14:09 2013 -0700 +++ b/service/bedroomArduino/bedroomArduino.py Sun Sep 22 00:30:20 2013 -0700 @@ -69,7 +69,7 @@ self.settings.arduino.ping() self.set_header("Content-Type", "application/xhtml+xml") - self.write(open("index.html").read()) + self.write(open("index.xhtml").read()) class SpeakerChoice(PrettyErrorHandler, cyclone.web.RequestHandler): def put(self): @@ -77,6 +77,10 @@ self.write(ret) class Brite(PrettyErrorHandler, cyclone.web.RequestHandler): + def get(self, which): + self.set_header("Content-Type", "text/plain") + self.write(hexFromRgb(self.settings.brites[int(which)])) + def put(self, which): which = int(which) brites = self.settings.brites @@ -166,7 +170,7 @@ ard = ArduinoBedroom(port=config['arduinoPort']) - period = 1/config['pollFrequency'] + period = 1 / config['pollFrequency'] p = Poller(config, ard, period) task.LoopingCall(p.poll).start(period)