Mercurial > code > home > repos > homeauto
diff service/bedroomArduino/bedroomArduino.py @ 117:1fada3a61c5f
bedroomarduino updates
Ignore-this: eeb3e527e652601b04ddd1d18f0f15f3
author | drewp@bigasterisk.com |
---|---|
date | Sun, 22 Sep 2013 00:30:20 -0700 |
parents | 8e55a6a9c425 |
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)