Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
B
bmon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
energy
bmon
Commits
ae79f041
Commit
ae79f041
authored
Jul 16, 2019
by
Alan Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added SNR to fields recorded from Things Network.
parent
95f8a19b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
bmsapp/views.py
bmsapp/views.py
+7
-0
No files found.
bmsapp/views.py
View file @
ae79f041
...
@@ -272,7 +272,14 @@ def store_readings_things(request):
...
@@ -272,7 +272,14 @@ def store_readings_things(request):
for
fld
,
val
in
req_data
[
'payload_fields'
].
items
():
for
fld
,
val
in
req_data
[
'payload_fields'
].
items
():
if
fld
not
in
EXCLUDE_THINGS_FIELDS
:
if
fld
not
in
EXCLUDE_THINGS_FIELDS
:
readings
.
append
(
[
ts
,
f'
{
hdw_serial
}
_
{
fld
}
'
,
val
]
)
readings
.
append
(
[
ts
,
f'
{
hdw_serial
}
_
{
fld
}
'
,
val
]
)
# Also extract the max SNR received by gateways that received this
# message
snrs
=
[
gtw
[
'snr'
]
for
gtw
in
req_data
[
'metadata'
][
'gateways'
]]
readings
.
append
([
ts
,
f'
{
hdw_serial
}
_snr'
,
max
(
snrs
)])
msg
=
storereads
.
store_many
({
'readings'
:
readings
})
msg
=
storereads
.
store_many
({
'readings'
:
readings
})
return
HttpResponse
(
msg
)
return
HttpResponse
(
msg
)
else
:
else
:
_logger
.
warning
(
'Invalid Storage Key in Reading Post: %s'
,
storeKey
)
_logger
.
warning
(
'Invalid Storage Key in Reading Post: %s'
,
storeKey
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment