Skip to content

Commit 209f94f

Browse files
rubenmoraldiescalo
authored andcommitted
samples: minor fixes in the tank monitoring sample
Signed-off-by: Ruben Moral <ruben.moral@digi.com>
1 parent 0eecd66 commit 209f94f

File tree

1 file changed

+3
-3
lines changed
  • samples/demos/end_to_end_tank

1 file changed

+3
-3
lines changed

samples/demos/end_to_end_tank/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ def read_properties():
135135
properties[prop] = None
136136

137137
# Read the XBee settings saved in the firmware.
138-
for prop in xbee_properties:
139-
read_value = xbee.atcmd(xbee_properties[prop])
138+
for prop, atcmd in xbee_properties.items():
139+
read_value = xbee.atcmd(atcmd)
140140
if read_value is None:
141141
properties[prop] = None
142142
elif prop in text_properties:
@@ -164,7 +164,7 @@ def save_properties(properties):
164164
# Save XBee properties in the XBee firmware.
165165
for prop in xbee_properties:
166166
# Skip empty settings.
167-
if prop not in properties or properties[prop] is None:
167+
if properties.get(prop) is None:
168168
continue
169169
print(" - Saving property '%s' with '%s' in the XBee device" %
170170
(prop, properties[prop]))

0 commit comments

Comments
 (0)