Modifying 'LaMetric Time device handler and smart apps'

This commit is contained in:
Nazar Bilous
2016-06-22 07:51:10 -05:00
parent 11e047e31d
commit ab61db3699
2 changed files with 5 additions and 3 deletions

View File

@@ -753,7 +753,9 @@ def sendNotificationMessageToDevice(dni, data)
body: data,
headers: [
HOST: "${localIp}:8080",
Authorization: "Basic ${"${localApiUser}:${apiKey}".bytes.encodeBase64()}"
Authorization: "Basic ${"${localApiUser}:${apiKey}".bytes.encodeBase64()}",
"Content-type":"application/json",
"Accept":"application/json"
]]))
}
}
@@ -766,7 +768,7 @@ def getAllInfoFromDevice(localIp, apiKey)
sendHubCommand(new physicalgraph.device.HubAction([
method: "GET",
path: localApiIndexPath,
query:[info:1,bluetooth:1,wifi:1,audio:1,display:1],
query:["fields": ["info","wifi", "volume", "bluetooth"]],
headers: [
HOST: "${localIp}:8080",
Authorization: "Basic ${"${localApiUser}:${apiKey}".bytes.encodeBase64()}"

View File

@@ -124,7 +124,7 @@ def getDefaultIconData() { """data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgA
def mainPage() {
def iconRequestOptions = [headers: ["Accept": "application/json"],
uri: "${lametricHost}/api/v2/icons", query:["fields":"id,title,type,code"]];
uri: "${lametricHost}/api/v2/icons", query:["fields":"id,title,type,code", "order":"title"]]
def icons = getIconsList();
def iconLabels = getIconLabels();