@@ -135,10 +135,10 @@ def on_mqtt_disconnect(client, userdata, rc):
135
135
136
136
# Setup buttons
137
137
GPIO .setmode (GPIO .BCM )
138
- menu_button_pin = self .config .inputs .buttons_light
138
+ menu_button_pin = self .config .inputs .button_light
139
139
GPIO .setup (menu_button_pin , GPIO .IN , pull_up_down = GPIO .PUD_UP )
140
140
GPIO .add_event_detect (menu_button_pin , GPIO .FALLING , callback = self .lightButtonPressed , bouncetime = 500 )
141
- timer_button_pin = self .config .inputs .buttons_display
141
+ timer_button_pin = self .config .inputs .button_display
142
142
GPIO .setup (timer_button_pin , GPIO .IN , pull_up_down = GPIO .PUD_UP )
143
143
GPIO .add_event_detect (timer_button_pin , GPIO .FALLING , callback = self .displayButtonPressed , bouncetime = 500 )
144
144
@@ -147,7 +147,7 @@ def on_mqtt_disconnect(client, userdata, rc):
147
147
def publishData (self , temperature , humidity ):
148
148
mqttConfig = self .config .mqtt
149
149
if mqttConfig .enable :
150
- self .mqttc .publish (mqttConfig .temp_topic , payload = "{:0.1f}" .format (temperature ), retain = True )
150
+ self .mqttc .publish (mqttConfig .temperature_topic , payload = "{:0.1f}" .format (temperature ), retain = True )
151
151
self .mqttc .publish (mqttConfig .humidity_topic , payload = "{:0.1f}" .format (humidity ), retain = True )
152
152
153
153
@@ -385,7 +385,7 @@ def getData(self):
385
385
# Try to grab a sensor reading and publish it. Use the read_retry method which will retry up
386
386
# to 15 times to get a sensor reading (waiting 2 seconds between each retry).
387
387
sensorConfig = self .config .temperature
388
- humidity , temperature = Adafruit_DHT .read_retry (locals ()[ sensorConfig .sensor_type ] , sensorConfig .pin )
388
+ humidity , temperature = Adafruit_DHT .read_retry (getattr ( Adafruit_DHT , sensorConfig .sensor_type ) , sensorConfig .pin )
389
389
390
390
if humidity is not None and temperature is not None :
391
391
self .humidity = humidity
0 commit comments