if (FALSE) {
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()
### create thing ###
things_create(name = "test")
### check things list ###
t_list = things_list(silent = TRUE)
thing_id = t_list %>% filter(name == "test") %>% pull(id)
things_show(thing_id = thing_id)
### update thing ###
properties = tibble(name = c("test1", "test2"),
permission = rep("READ_ONLY", 2), type = rep("FLOAT", 2),
update_strategy = rep("ON_CHANGE", 2), update_parameter = rep(10, 2))
things_update(thing_id = thing_id, name = "test_update", properties = properties)
### delete thing ###
things_delete(thing_id = thing_id)
}
Run the code above in your browser using DataLab