kizniche / Mycodo

An environmental monitoring and regulation system
http://kylegabriel.com/projects/
GNU General Public License v3.0
3k stars 500 forks source link

Error on activation of BH1750 sensor #480

Closed cohe4ko closed 6 years ago

cohe4ko commented 6 years ago

Mycodo Issue Report:

Problem Description

scr When I try to activate BH1750 sensor.

Errors

2018-05-21 02:03:10,142 - mycodo.daemon - ERROR - Could not activate Input controller with ID d56ebfbc-37a2-4d02-88db-6ccbf402b8b9: 'BH1750Sensor' object has no attribute 'POWER_DOWN' Traceback (most recent call last): File "/var/mycodo-root/mycodo/mycodo_daemon.py", line 480, in controller_activate ready, cont_id) File "/var/mycodo-root/mycodo/controller_input.py", line 251, in init self.measure_input = BH1750Sensor(self.input_dev) File "/var/mycodo-root/mycodo/inputs/bh1750.py", line 45, in init self.power_down() File "/var/mycodo-root/mycodo/inputs/bh1750.py", line 106, in power_down self._set_mode(self.POWER_DOWN) AttributeError: 'BH1750Sensor' object has no attribute 'POWER_DOWN'

kizniche commented 6 years ago

Just pushed a fix. It will be available in the next release.