From 997dbc4071c7dadd8ac0dd7bf580a088b7c761ab Mon Sep 17 00:00:00 2001 From: Bart Van Der Meerssche Date: Tue, 26 Apr 2011 10:25:14 +0200 Subject: [PATCH] [fsync] include phase information when updating sensor info to the server --- mote/v2/openwrt/package/flukso/luasrc/fsync.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mote/v2/openwrt/package/flukso/luasrc/fsync.lua b/mote/v2/openwrt/package/flukso/luasrc/fsync.lua index d2ceffb..edd8fe2 100755 --- a/mote/v2/openwrt/package/flukso/luasrc/fsync.lua +++ b/mote/v2/openwrt/package/flukso/luasrc/fsync.lua @@ -407,6 +407,15 @@ local function phone_home() config["constant"] = tonumber(flukso[i]["constant"]) config["enable"] = tonumber(flukso[i]["enable"]) + if config["class"] == "analog" then + local phase = tonumber(flukso.main.phase) + + if phase == 1 or + phase == 3 and i == "1" then + config["phase"] = phase + end + end + return luci.json.encode{ config = config } end