File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ def send_to_luftdaten(values, id):
127127
128128 resp_pm = None
129129 resp_bmp = None
130-
130+
131131 try :
132132 resp_pm = requests .post (
133133 "https://api.luftdaten.info/v1/push-sensor-data/" ,
@@ -150,7 +150,7 @@ def send_to_luftdaten(values, id):
150150 except requests .exceptions .RequestException as e :
151151 logging .warning ('Luftdaten PM Request Error: {}' .format (e ))
152152
153- try :
153+ try :
154154 resp_bmp = requests .post (
155155 "https://api.luftdaten.info/v1/push-sensor-data/" ,
156156 json = {
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
12"""
23Run mqtt broker on localhost: sudo apt-get install mosquitto mosquitto-clients
34
45Example run: python3 mqtt-all.py --broker 192.168.1.164 --topic enviro --username xxx --password xxxx
56"""
6- #!/usr/bin/env python3
77
88import argparse
99import ST7735
4343DEFAULT_USERNAME = None
4444DEFAULT_PASSWORD = None
4545
46+
4647# mqtt callbacks
4748def on_connect (client , userdata , flags , rc ):
4849 if rc == 0 :
@@ -99,7 +100,7 @@ def get_cpu_temperature():
99100 ["vcgencmd" , "measure_temp" ], stdout = PIPE , universal_newlines = True
100101 )
101102 output , _error = process .communicate ()
102- return float (output [output .index ("=" ) + 1 : output .rindex ("'" )])
103+ return float (output [output .index ("=" ) + 1 : output .rindex ("'" )])
103104
104105
105106# Get Raspberry Pi serial number to use as ID
@@ -240,7 +241,7 @@ def main():
240241 HAS_PMS = False
241242 try :
242243 pms5003 = PMS5003 ()
243- pm_values = pms5003 .read ()
244+ _ = pms5003 .read ()
244245 HAS_PMS = True
245246 print ("PMS5003 sensor is connected" )
246247 except SerialTimeoutError :
You can’t perform that action at this time.
0 commit comments