Skip to content

Commit 0a40c24

Browse files
brentrubrentru
authored andcommitted
lintin
1 parent e6e8a96 commit 0a40c24

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

PyPortal_AWS_IOT_Planter/aws_gfx_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,4 @@ def set_icon(self, filename):
146146

147147
self._icon_group.append(self._icon_sprite)
148148
self.display.refresh_soon()
149-
self.display.wait_for_frame()
149+
self.display.wait_for_frame()

PyPortal_AWS_IOT_Planter/code.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import aws_gfx_helper
2222

2323
# Time between polling the STEMMA, in minutes
24-
SENSOR_DELAY = 0.2
24+
SENSOR_DELAY = 15
2525

2626
# Get wifi details and more from a secrets.py file
2727
try:
@@ -94,7 +94,6 @@ def connect(client, userdata, flags, rc):
9494
print("Subscribing to shadow updates...")
9595
aws_iot.shadow_subscribe()
9696

97-
9897
def disconnect(client, userdata, rc):
9998
# This method is called when the client disconnects
10099
# from the broker.
@@ -155,9 +154,8 @@ def message(client, topic, msg):
155154
print('Sending data to AWS IoT...')
156155
gfx.show_aws_status('Publishing data...')
157156
# Create a json-formatted device payload
158-
payload = {"state":{"reported":
159-
{"moisture":str(moisture),
160-
"temp":str(temperature)}}}
157+
payload = {"state":{"reported":{"moisture":str(moisture),
158+
"temp":str(temperature)}}}
161159
# Update device shadow
162160
aws_iot.shadow_update(json.dumps(payload))
163161
gfx.show_aws_status('Data published!')

0 commit comments

Comments
 (0)