module Rtelldus
Constants
- VERSION
Public Class Methods
clients_list()
click to toggle source
Clients
# File lib/rtelldus.rb, line 57 def self.clients_list authorize unless @access_token json_txt = @access_token.get("/json/clients/list", 'x-li-format' => 'json').body clients = JSON.parse(json_txt) end
device_bell(device_id)
click to toggle source
# File lib/rtelldus.rb, line 95 def self.device_bell device_id authorize unless @access_token json_txt = @access_token.post("/json/device/bell", {"id" => device_id}, 'x-li-format' => 'json').body status = JSON.parse(json_txt) end
device_dim(device_id, level)
click to toggle source
# File lib/rtelldus.rb, line 88 def self.device_dim device_id, level raise "Invalid dimlevel, this value should be 0-255" if level < 0 or level > 255 authorize unless @access_token json_txt = @access_token.post("/json/device/dim", {"id" => device_id, "level" => level}, 'x-li-format' => 'json').body status = JSON.parse(json_txt) end
device_info(device_id)
click to toggle source
# File lib/rtelldus.rb, line 70 def self.device_info device_id authorize unless @access_token json_txt = @access_token.post("/json/device/info", {"id" => device_id}, 'x-li-format' => 'json').body status = JSON.parse(json_txt) end
device_turn_off(device_id)
click to toggle source
# File lib/rtelldus.rb, line 82 def self.device_turn_off device_id authorize unless @access_token json_txt = @access_token.post("/json/device/turnOff", {"id" => device_id}, 'x-li-format' => 'json').body status = JSON.parse(json_txt) end
device_turn_on(device_id)
click to toggle source
# File lib/rtelldus.rb, line 76 def self.device_turn_on device_id authorize unless @access_token json_txt = @access_token.post("/json/device/turnOn", {"id" => device_id}, 'x-li-format' => 'json').body status = JSON.parse(json_txt) end
devices_list()
click to toggle source
Devices
# File lib/rtelldus.rb, line 64 def self.devices_list authorize unless @access_token json_txt = @access_token.get("/json/devices/list", 'x-li-format' => 'json').body devices = JSON.parse(json_txt) end
sensor_info(sensor_id)
click to toggle source
# File lib/rtelldus.rb, line 108 def self.sensor_info sensor_id authorize unless @access_token json_txt = @access_token.post("/json/sensor/info", {"id" => sensor_id}, 'x-li-format' => 'json').body status = JSON.parse(json_txt) end
sensors_list()
click to toggle source
Sensors
# File lib/rtelldus.rb, line 102 def self.sensors_list authorize unless @access_token json_txt = @access_token.get("/json/sensors/list", 'x-li-format' => 'json').body devices = JSON.parse(json_txt) end