(regObj)
| 558 | |
| 559 | |
| 560 | def handle_light(regObj): |
| 561 | sensors = {} |
| 562 | light_reading = 0 |
| 563 | port = "AD2" if regObj.group(SENSOR_LIGHT_PORT2_GROUP) else "AD1" |
| 564 | light = get_sensor_instance(port, easysensors.LightSensor) |
| 565 | if light: |
| 566 | light_reading = light.percent_read() |
| 567 | sensors["{}: Light".format(port)] = light_reading |
| 568 | else: |
| 569 | return ({"{}: Light".format(port):"technical difficulties"}) |
| 570 | return sensors |
| 571 | |
| 572 | |
| 573 | def handle_loudness(regObj): |
no test coverage detected