Clean-up severe thunderstorm and tornado alert presentation
This commit is contained in:
@ -34,13 +34,20 @@ let tornado = alerts.filter(function(alert) {
|
||||
|
||||
// If there are any alerts, return them
|
||||
|
||||
msg.ts = ts
|
||||
msg.ts_count = ts.length
|
||||
let tstormMsg = {
|
||||
"payload": {
|
||||
"alerts": ts,
|
||||
"count": ts.length,
|
||||
"tornado_possible": tstp.length
|
||||
}
|
||||
}
|
||||
|
||||
msg.tstp = tstp
|
||||
msg.tstp_count = tstp.length
|
||||
let tornadoWarnMsg = {
|
||||
"payload": {
|
||||
"alerts": tornado,
|
||||
"count": tornado.length
|
||||
}
|
||||
}
|
||||
|
||||
msg.tornado = tornado
|
||||
msg.tornado_count = tornado.length
|
||||
|
||||
return msg
|
||||
node.send([tstormMsg,tornadoWarnMsg])
|
||||
node.status({fill:'green',shape:'dot',text:'Alerts Updated'})
|
@ -1,4 +1,5 @@
|
||||
let alerts = msg.payload.features
|
||||
let tornado_possible = false
|
||||
|
||||
// Filter for Severe Thunderstorm Warnings
|
||||
|
||||
@ -23,6 +24,10 @@ let tstp = alerts.filter(function(alert) {
|
||||
}
|
||||
})
|
||||
|
||||
if (tstp.length > 0) {
|
||||
tornado_possible = true
|
||||
}
|
||||
|
||||
// Filter for Tornado Warnings
|
||||
|
||||
let tornado = alerts.filter(function(alert) {
|
||||
@ -34,13 +39,20 @@ let tornado = alerts.filter(function(alert) {
|
||||
|
||||
// If there are any alerts, return them
|
||||
|
||||
msg.ts = ts
|
||||
msg.ts_count = ts.length
|
||||
let tstormMsg = {
|
||||
"payload": {
|
||||
"alerts": ts,
|
||||
"count": ts.length,
|
||||
"tornado_possible": tornado_possible
|
||||
}
|
||||
}
|
||||
|
||||
msg.tstp = tstp
|
||||
msg.tstp_count = tstp.length
|
||||
let tornadoWarnMsg = {
|
||||
"payload": {
|
||||
"alerts": tornado,
|
||||
"count": tornado.length
|
||||
}
|
||||
}
|
||||
|
||||
msg.tornado = tornado
|
||||
msg.tornado_count = tornado.length
|
||||
|
||||
return msg
|
||||
node.send([tstormMsg,tornadoWarnMsg])
|
||||
node.status({fill:'green',shape:'dot',text:'Alerts Updated'})
|
Reference in New Issue
Block a user