class HueResource

Public Class Methods

new(key, hash_value) click to toggle source
# File lib/ha/hue_resource.rb, line 2
def initialize(key, hash_value)
  @hash_value = hash_value
  @lastupdated = @hash_value.dig("state", "lastupdated")
  @detail = hash_value["type"]
  @name = hash_value["name"]
  @state = { "key" => key, "lastupdated" => @lastupdated, "detail" => @detail, "name" => @name}
end

Public Instance Methods

gen_reskey(detail) click to toggle source
# File lib/ha/hue_resource.rb, line 10
def gen_reskey(detail)
  @state.merge!({ "id" => detail + @state["key"]})
end