aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-10-16 17:21:13 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2015-10-16 17:21:13 +0200
commitd47cfeb625ffcd08e6391b52f05504886bc54338 (patch)
tree64367f046c94101c9008883d5c07eea23fecdbe6
parent446931c5f5d09a62e167c1754fbe17773eaae6a4 (diff)
downloadesp-playground-d47cfeb625ffcd08e6391b52f05504886bc54338.tar.gz
esp-playground-d47cfeb625ffcd08e6391b52f05504886bc54338.tar.bz2
esp-playground-d47cfeb625ffcd08e6391b52f05504886bc54338.tar.xz
esp-playground-d47cfeb625ffcd08e6391b52f05504886bc54338.zip
wip
-rw-r--r--diller/README.md2
-rw-r--r--diller/main.lua8
2 files changed, 5 insertions, 5 deletions
diff --git a/diller/README.md b/diller/README.md
index 72d5778..b2d96f8 100644
--- a/diller/README.md
+++ b/diller/README.md
@@ -7,7 +7,7 @@ Is registration required? Can't the firmware just send an update without a value
## Device / Sensor hierarchy
/<device id>
- /sensors
+ /sensor
/<sensor id>
/value
/type (retained)
diff --git a/diller/main.lua b/diller/main.lua
index 234a84b..533ecc8 100644
--- a/diller/main.lua
+++ b/diller/main.lua
@@ -48,8 +48,9 @@ local function on_cmd(cmd, args)
else
property = properties[id]
- local name_path = id.."/name"
- local description_path = id.."/description"
+ local value_path = "sensors/"..id.."/value"
+ local name_path = "sensors/"..id.."/name"
+ local description_path = "sensors/"..id.."/description"
if not property then
print("new property: "..id)
@@ -60,8 +61,7 @@ local function on_cmd(cmd, args)
end
if args.value then
- local path = id.."/value"
- mq.publish(path, args.value)
+ mq.publish(value_path, args.value)
end
if args.name and property.name ~= args.name then
print("publishing name")