mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-06-16 19:38:34 +00:00
Additional changes for the previous merge.
This commit is contained in:
@ -93,6 +93,7 @@ class HomeAssistantMenuItem extends WatchUi.MenuItem {
|
||||
var options = {
|
||||
:method => Communications.HTTP_REQUEST_METHOD_POST,
|
||||
:headers => {
|
||||
"Content-Type" => Communications.REQUEST_CONTENT_TYPE_JSON,
|
||||
"Authorization" => "Bearer " + api_key
|
||||
},
|
||||
:responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON
|
||||
@ -114,10 +115,10 @@ class HomeAssistantMenuItem extends WatchUi.MenuItem {
|
||||
method(:onReturnExecScript)
|
||||
);
|
||||
} else {
|
||||
var url = Properties.getValue("api_url") + "/services/" + mService.substring(0, mService.find(".")) + "/" + mService.substring(mService.find(".")+1, null);
|
||||
var url = (Properties.getValue("api_url") as Lang.String) + "/services/" + mService.substring(0, mService.find(".")) + "/" + mService.substring(mService.find(".")+1, null);
|
||||
if (Globals.debug) {
|
||||
System.println("URL=" + url);
|
||||
System.println("mIdentifier=" + mIdentifier);
|
||||
System.println("HomeAssistantMenuItem execScript() URL=" + url);
|
||||
System.println("HomeAssistantMenuItem execScript() mIdentifier=" + mIdentifier);
|
||||
}
|
||||
Communications.makeWebRequest(
|
||||
url,
|
||||
@ -125,7 +126,7 @@ class HomeAssistantMenuItem extends WatchUi.MenuItem {
|
||||
"entity_id" => id
|
||||
},
|
||||
options,
|
||||
method(:onReturnSetState)
|
||||
method(:onReturnExecScript)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user