projects
/
weathermon.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ee2fccf
)
Workaround for broken data transmission from Arduino part
author
Roman Bazalevsky
<rvb@rvb.name>
Fri, 26 Sep 2014 08:05:50 +0000
(12:05 +0400)
committer
Roman Bazalevsky
<rvb@rvb.name>
Fri, 26 Sep 2014 08:05:50 +0000
(12:05 +0400)
weathermon
patch
|
blob
|
history
diff --git
a/weathermon
b/weathermon
index 7b78ca735ec97f0d0aa49415dea047d1297eccba..66d6ac4390603399baeec4f11401fba71839a832 100755
(executable)
--- a/
weathermon
+++ b/
weathermon
@@
-210,17
+210,19
@@
def process_str(str):
sensor_id = None
for rec in sens:
key,value = rec.split('=')
sensor_id = None
for rec in sens:
key,value = rec.split('=')
- if key == 'TYPE':
- sensor_type = value
- elif key == 'ID':
- sensor_id = value
- else:
- sensor[key] = value
+ value=value.strip()
+ if len(value)>0:
+ if key == 'TYPE':
+ sensor_type = value
+ elif key == 'ID':
+ sensor_id = value
+ else:
+ sensor[key] = value
if sensor_type:
if not sensor_id:
sensor_id='DEFAULT';
for key in sensor:
if sensor_type:
if not sensor_id:
sensor_id='DEFAULT';
for key in sensor:
- if sensor[key]
is not None
:
+ if sensor[key]:
print_log('Type = '+sensor_type+', ID = '+sensor_id+', Param = '+key+', Value = '+sensor[key])
submit_data(sensor_type,sensor_id,key,sensor[key])
else:
print_log('Type = '+sensor_type+', ID = '+sensor_id+', Param = '+key+', Value = '+sensor[key])
submit_data(sensor_type,sensor_id,key,sensor[key])
else: