This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

HifiBerry API GET
#5
(10.05.2021, 12:30)admin Wrote:
Code:
if res then
  res = require('json').pdecode(res)
  if type(res) == 'table' and res.volume then
    grp.checkupdate('1/2/3', res.volume)
  end
end

Thanks a lot. The code below works perfectly.

Code:
res, code = require('socket.http').request('http://192.168.1.91:81/api/volume')
--log(res, code)

if res then
  res = require('json').pdecode(res)
  if type(res) == 'table' and res.percent then
    grp.checkupdate('25/2/12', res.percent)
  end
end
BR
Kai-Roger
Reply


Messages In This Thread
HifiBerry API GET - by Kai-Roger - 10.05.2021, 11:58
RE: HifiBerry API GET - by admin - 10.05.2021, 12:01
! - by Kai-Roger - 10.05.2021, 12:28
RE: HifiBerry API GET - by admin - 10.05.2021, 12:30
RE: HifiBerry API GET - by Kai-Roger - 10.05.2021, 12:49

Forum Jump: