| Conditions | 2 |
| Total Lines | 8 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | '''what to do when a sensor reading is broadcast''' |
||
| 7 | def when_sensor(channel, method, properties, body): |
||
| 8 | '''when there is a sensor reading''' |
||
| 9 | try: |
||
| 10 | print("[{0}] Received sensor reading".format(SENSOR.app.now())) |
||
| 11 | message, sensorvalue = SENSOR.app.messagedecodesensor(body) |
||
| 12 | dosensor(message, sensorvalue) |
||
| 13 | except Exception as ex: |
||
| 14 | SENSOR.app.logexception(ex) |
||
| 15 | |||
| 25 |