Skip to content

Commit

Permalink
fix json parsing error if actuator GET endpoint returns an error
Browse files Browse the repository at this point in the history
  • Loading branch information
heythisisnate committed Sep 20, 2018
1 parent 560a2e2 commit 225d54b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Binary file modified firmware/konnected-filesystem-0xf0000-2-2-4.img
Binary file not shown.
2 changes: 1 addition & 1 deletion src/application.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ sendTimer:alarm(200, tmr.ALARM_AUTO, function(t)
function(code, response)
timeout:stop()
local pin, state, json_response
if response then
if response and code >= 200 and code < 300 then
json_response = sjson.decode(response)
pin = json_response.pin
state = json_response.state
Expand Down
4 changes: 2 additions & 2 deletions src/device.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
local me = {
id = "uuid:8f655392-a778-4fee-97b9-4825918" .. string.format("%x", node.chipid()),
name = "Konnected",
hwVersion = "2.2.4.beta1",
swVersion = "2.2.4.beta1",
hwVersion = "2.2.4",
swVersion = "2.2.4",
http_port = math.floor(node.chipid()/1000) + 8000,
urn = "urn:schemas-konnected-io:device:Security:1"
}
Expand Down

0 comments on commit 225d54b

Please sign in to comment.