Class: HueConfig
Instance Attribute Summary collapse
-
#api_version ⇒ Object
readonly
Returns the value of attribute api_version.
-
#dhcp ⇒ Object
readonly
Returns the value of attribute dhcp.
-
#gateway ⇒ Object
readonly
Returns the value of attribute gateway.
-
#ip_address ⇒ Object
readonly
Returns the value of attribute ip_address.
-
#link_button ⇒ Object
readonly
Returns the value of attribute link_button.
-
#local_time ⇒ Object
readonly
Returns the value of attribute local_time.
-
#mac ⇒ Object
readonly
Returns the value of attribute mac.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#netmask ⇒ Object
readonly
Returns the value of attribute netmask.
-
#portal_connection ⇒ Object
readonly
Returns the value of attribute portal_connection.
-
#portal_services ⇒ Object
readonly
Returns the value of attribute portal_services.
-
#portal_state ⇒ Object
readonly
Returns the value of attribute portal_state.
-
#proxy_address ⇒ Object
readonly
Returns the value of attribute proxy_address.
-
#proxy_port ⇒ Object
readonly
Returns the value of attribute proxy_port.
-
#sw_update ⇒ Object
readonly
Returns the value of attribute sw_update.
-
#swversion ⇒ Object
readonly
Returns the value of attribute swversion.
-
#time_zone ⇒ Object
readonly
Returns the value of attribute time_zone.
-
#utc ⇒ Object
readonly
Returns the value of attribute utc.
-
#whitelist ⇒ Object
readonly
Returns the value of attribute whitelist.
-
#zigbee_channel ⇒ Object
readonly
Returns the value of attribute zigbee_channel.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(data = {}) ⇒ HueConfig
constructor
A new instance of HueConfig.
Methods inherited from HObject
Constructor Details
#initialize(data = {}) ⇒ HueConfig
Returns a new instance of HueConfig.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/lights/config.rb', line 12 def initialize(data = {}) @name = data["name"] @zigbee_channel = data["zigbeechannel"] @mac = data["mac"] @dhcp = data["dhcp"] @ip_address = data["ipaddress"] @netmask = data["netmask"] @gateway = data["gateway"] @proxy_address = data["proxyaddress"] @proxy_port = data["proxyport"] @utc = data["UTC"] @local_time = data["localtime"] @time_zone = data["timezone"] @whitelist = UserList.new(data["whitelist"]) @sw_version = data["swversion"] @api_version = data["apiversion"] @sw_update = data["swupdate"] @link_button = data["linkbutton"] @portal_services = data["portalservices"] @portal_connection = data["portalconnection"] @portal_state = data["portalstate"] end |
Instance Attribute Details
#api_version ⇒ Object (readonly)
Returns the value of attribute api_version.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def api_version @api_version end |
#dhcp ⇒ Object (readonly)
Returns the value of attribute dhcp.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def dhcp @dhcp end |
#gateway ⇒ Object (readonly)
Returns the value of attribute gateway.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def gateway @gateway end |
#ip_address ⇒ Object (readonly)
Returns the value of attribute ip_address.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def ip_address @ip_address end |
#link_button ⇒ Object (readonly)
Returns the value of attribute link_button.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def @link_button end |
#local_time ⇒ Object (readonly)
Returns the value of attribute local_time.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def local_time @local_time end |
#mac ⇒ Object (readonly)
Returns the value of attribute mac.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def mac @mac end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def name @name end |
#netmask ⇒ Object (readonly)
Returns the value of attribute netmask.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def netmask @netmask end |
#portal_connection ⇒ Object (readonly)
Returns the value of attribute portal_connection.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def portal_connection @portal_connection end |
#portal_services ⇒ Object (readonly)
Returns the value of attribute portal_services.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def portal_services @portal_services end |
#portal_state ⇒ Object (readonly)
Returns the value of attribute portal_state.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def portal_state @portal_state end |
#proxy_address ⇒ Object (readonly)
Returns the value of attribute proxy_address.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def proxy_address @proxy_address end |
#proxy_port ⇒ Object (readonly)
Returns the value of attribute proxy_port.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def proxy_port @proxy_port end |
#sw_update ⇒ Object (readonly)
Returns the value of attribute sw_update.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def sw_update @sw_update end |
#swversion ⇒ Object (readonly)
Returns the value of attribute swversion.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def swversion @swversion end |
#time_zone ⇒ Object (readonly)
Returns the value of attribute time_zone.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def time_zone @time_zone end |
#utc ⇒ Object (readonly)
Returns the value of attribute utc.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def utc @utc end |
#whitelist ⇒ Object (readonly)
Returns the value of attribute whitelist.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def whitelist @whitelist end |
#zigbee_channel ⇒ Object (readonly)
Returns the value of attribute zigbee_channel.
5 6 7 |
# File 'lib/lights/config.rb', line 5 def zigbee_channel @zigbee_channel end |
Instance Method Details
#data ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/lights/config.rb', line 35 def data data = {} data["name"] = @name if @name data["zigbeechannel"] = @zigbee_channel if @zigbee_channel data["mac"] = @mac if @mac data["dhcp"] = @dhcp unless @dhcp.nil? data["ipaddress"] = @ip_address if @ip_address data["netmask"] = @netmask if @netmask data["gateway"] = @gateway if @gateway data["proxyaddress"] = @proxy_address if @proxy_address data["proxyport"] = @proxy_port if @proxy_port data["UTC"] = @utc if @utc data["localtime"] = @local_time if @local_time data["timezone"] = @time_zone if @time_zone data["whitelist"] = @whitelist.data unless @whitelist.data.empty? data["swversion"] = @sw_version if @sw_version data["apiversion"] = @api_version if @api_version data["swupdate"] = @sw_update unless @sw_update.nil? data["linkbutton"] = @link_button unless @link_button.nil? data["portalservices"] = @portal_services unless @portal_services.nil? data["portalconnection"] = @portal_connection if @portal_connection data["portalstate"] = @portal_state unless @portal_state.nil? data end |