Skip to content

Commit

Permalink
finish insert code
Browse files Browse the repository at this point in the history
  • Loading branch information
b1conrad committed Mar 16, 2024
1 parent 5a40e7f commit 2f46877
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions krl/io.picolabs.plan.wovyn-sensors.krl
Original file line number Diff line number Diff line change
Expand Up @@ -254,24 +254,22 @@ daysInRecord()
clear ent:mapping{name}
}
}
rule addSensorMapping {
rule insertSensorMapping {
select when io_picolabs_plan_wovyn_sensors sensor_needed
name re#(Wovyn_[A-F0-9]{6})#
location re#(.+)#
setting(name,location)
pre {
new_location = {}.put(name,location)
.klog("new_location")
new_mapping = ent:mapping
.keys()
.reduce(function(a,k){
a.put(k,ent:mapping.get(k))
},new_location)
.klog("new_mapping")
}
send_directive("_redirect",{"url":settings_link()})
fired {
ent:mapping{name} := location
ent:mapping := new_mapping
}
}
rule acceptHeartbeat {
Expand Down

0 comments on commit 2f46877

Please sign in to comment.