Skip to content

Commit

Permalink
fix4
Browse files Browse the repository at this point in the history
  • Loading branch information
torchiaf committed Feb 2, 2025
1 parent 82c501c commit a9da17d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 1 addition & 6 deletions modules/raspberrypi3b/devices/dht11/app/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import json
import Adafruit_DHT
from config import device

Expand All @@ -11,11 +10,7 @@
try:
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)

d = dict();
d['t'] = temperature
d['h'] = humidity

print(print(json.dumps(d)))
print('{{\\\"t\\\": {}, \\\"h\\\": {}}}'.format(temperature, humidity))

except:
print("read() error")
7 changes: 1 addition & 6 deletions modules/raspberrypi5/devices/dht11/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@
dhtDevice = _device(_board)

try:
d = dict();

d['t'] = dhtDevice.temperature
d['h'] = dhtDevice.humidity

print(print(json.dumps(d)))
print('{{\\\"t\\\": {}, \\\"h\\\": {}}}'.format(dhtDevice.temperature, dhtDevice.humidity))

except Exception as error:
# dhtDevice.exit()
Expand Down

0 comments on commit a9da17d

Please sign in to comment.