things_properties {Rduinoiot} | R Documentation |
Properties (of things) API methods
Description
Create, Update, List, Show and Delete properties associated to a given thing
Official documentation:
Usage
things_properties_create(
thing_id,
name,
permission,
type,
update_strategy,
...,
store_token = "option",
token = NULL,
silent = FALSE
)
things_properties_update(
thing_id,
property_id,
name,
permission,
type,
update_strategy,
...,
store_token = "option",
token = NULL,
silent = FALSE
)
things_properties_list(
thing_id,
show_deleted = FALSE,
store_token = "option",
token = NULL,
silent = FALSE
)
things_properties_show(
thing_id,
property_id,
store_token = "option",
token = NULL,
silent = FALSE
)
things_properties_delete(
thing_id,
property_id,
store_token = "option",
token = NULL,
silent = FALSE
)
Arguments
thing_id |
The id of the thing |
name |
The friendly name of the property |
permission |
The permission of the property (READ_ONLY or READ_WRITE allowed) |
type |
The type of the property (see details for exhaustive list of values) |
update_strategy |
The update strategy for the property value (ON_CHANGE or TIMED allowed) |
... |
Optional parameters for
|
store_token |
Where your token is stored. If |
token |
A valid token created with |
silent |
Whether to hide or show API method success messages (default |
property_id |
The id of the property |
show_deleted |
If |
Value
A tibble showing information about chosen property or list of properties for given thing
Examples
## Not run:
library(dplyr)
Sys.setenv(ARDUINO_API_CLIENT_ID = 'INSERT CLIENT_ID HERE')
Sys.setenv(ARDUINO_API_CLIENT_SECRET = 'INSERT CLIENT_SECRET HERE')
create_auth_token()
thing_id = "b6822400-2f35-4d93-b3e7-be919bdc5eba"
### create property ###
things_properties_create(thing_id = thing_id,
name = "test", permission = "READ_ONLY", type = "FLOAT",
update_strategy = "ON_CHANGE", update_parameter = 10)
### check properties list ###
p_list = things_properties_list(thing_id = thing_id, show_deleted = FALSE)
property_id = p_list %>% filter(name == "test") %>% pull(id)
things_properties_show(thing_id = thing_id, property_id = property_id)
### update property ###
things_properties_update(thing_id = thing_id, property_id = property_id,
name = "test_update", permission = "READ_ONLY", type = "FLOAT",
update_strategy = "ON_CHANGE", update_parameter = 10)
### delete property ###
things_properties_delete(thing_id = thing_id, property_id = property_id)
## End(Not run)