# HG changeset patch # User drewp # Date 1356992133 28800 # Node ID 87111270eacf28b4786ab59eb50cfe5cc901aba6 # Parent 1815d2343a3fba8980828c87ce45a7d988d2a3c6 ping reasoning Ignore-this: d3f6507918bf146bd60147c3530417e darcs-hash:20121231221533-312f9-f41349a63f70a3f01b9e6d41b00ca0c6e012a352 diff -r 1815d2343a3f -r 87111270eacf service/tomatoWifi/tomatoWifi.py --- a/service/tomatoWifi/tomatoWifi.py Mon Dec 31 14:13:22 2012 -0800 +++ b/service/tomatoWifi/tomatoWifi.py Mon Dec 31 14:15:33 2012 -0800 @@ -11,7 +11,7 @@ Todo: this should be the one polling and writing to mongo, not entrancemusic """ from __future__ import division -import sys, cyclone.web, simplejson, traceback, time, pystache, datetime +import sys, cyclone.web, simplejson, traceback, time, pystache, datetime, restkit from dateutil import tz from twisted.internet import reactor, task @@ -36,7 +36,7 @@ DEV = Namespace("http://projects.bigasterisk.com/device/") ROOM = Namespace("http://projects.bigasterisk.com/room/") - +reasoning = restkit.Resource("http://bang:9071/") class Index(PrettyErrorHandler, cyclone.web.RequestHandler): def get(self): @@ -146,6 +146,13 @@ log.error("entrancemusic error: %r", e) self.lastWithSignal = newWithSignal + if actions: # this doesn't currently include signal strength changes + try: + reasoning.put("immediateUpdate", + # workaround for https://github.com/benoitc/restkit/issues/113 + headers={'User_Agent': 'tomatoWifi'}) + except Exception, e: + log.warn(e) self.lastAddrs = newAddrs self.lastPollTime = time.time() except Exception, e: