Updated Sammi API
Fixed delete_variable(), made button_id optional. Fixed incorrect api_path string.
This commit is contained in:
parent
25296ae38d
commit
9457488fa7
1 changed files with 7 additions and 4 deletions
|
|
@ -74,13 +74,16 @@ func set_variable(name: String, value: Variant, button_id: String = "") -> bool:
|
||||||
last_error_description = response.error_message
|
last_error_description = response.error_message
|
||||||
return false
|
return false
|
||||||
|
|
||||||
func delete_variable(name: String, button_id) -> bool:
|
func delete_variable(name: String, button_id: String = "") -> bool:
|
||||||
var api_path: String = "/api" % name
|
var api_path: String = "/api"
|
||||||
var req: Dictionary = {
|
var req: Dictionary = {
|
||||||
"request": "deleteVariable",
|
"request": "deleteVariable",
|
||||||
"name": name,
|
"name": name
|
||||||
"buttonID": button_id
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if button_id != "":
|
||||||
|
req["buttonID"] = button_id
|
||||||
|
|
||||||
client.request(SammiClient.Method.POST, api_path, JSON.stringify(req))
|
client.request(SammiClient.Method.POST, api_path, JSON.stringify(req))
|
||||||
var response: SammiClient.SammiResponse = await client.request_completed
|
var response: SammiClient.SammiResponse = await client.request_completed
|
||||||
if response.code == 200:
|
if response.code == 200:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue