Skip to content

Commit 401be46

Browse files
committed
[kubed+tmpod] tweak daemons for flm-ui
1 parent 84330d5 commit 401be46

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

openwrt/package/flukso/luasrc/kubed.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ local function load_config()
177177
end
178178
end
179179

180+
-- forcing uci to reload kube and flukso configs from file
181+
uci:load("kube")
182+
uci:load("flukso")
180183
KUBE = uci:get_all("kube")
181184
SENSOR = uci:get_all("flukso")
182185
CACHEDIR = load_cachedir()
@@ -412,6 +415,7 @@ local function provision_kube(hw_id_hex, hw_type_s)
412415
SENSOR = uci:get_all("flukso")
413416
end
414417
uci:commit("flukso")
418+
ub:send("flukso.sighup", {})
415419

416420
return tonumber(kid_s)
417421
end
@@ -435,6 +439,7 @@ local function deprovision_kube(kid_s)
435439
uci:delete("kube", kid_s)
436440
uci:save("kube")
437441
uci:commit("kube")
442+
ub:send("flukso.sighup", {})
438443
end
439444

440445
local function is_kid_allocated(kid_s, hw_type_s)
@@ -780,12 +785,20 @@ local ub_methods = {
780785
ub:add(ub_methods)
781786

782787
local ub_events = {
788+
["flukso.sighup"] = function(msg)
789+
event:process("e_init")
790+
end,
791+
783792
["flukso.kube.event"] = function(msg)
784793
if type(msg.event) == "string" then
785794
event:process(msg.event)
786795
end
787796
end,
788797

798+
["flukso.kube.pair"] = function(msg)
799+
event:process("e_pair")
800+
end,
801+
789802
["flukso.kube.packet.rx"] = function(msg)
790803
if type(msg.hex) ~= "string" then return end
791804
local arg = { bin = unhex(msg.hex), hex = msg.hex, hdr = { }, pld = { } }

openwrt/package/flukso/luasrc/tmpod.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ local config = {
149149
return otbl
150150
end
151151

152+
uci:load("flukso")
152153
self.sensor = clean(uci:get_all("flukso"))
153154
if DEBUG.config then dbg.vardump(self.sensor) end
154155
end

0 commit comments

Comments
 (0)