Sha256: 770029adde877743921a6c797be1f51dff7f674af551c147cef5274f926653fe

Contents?: true

Size: 592 Bytes

Versions: 4

Compression:

Stored size: 592 Bytes

Contents

# A class representing a light known to a Hue bridge.
# (C)2013-2015 Mike Bourgeous

module NLHue
	# A class representing a light known to a Hue bridge.  Recommended use
	# is to get a Light object by calling NLHue::Bridge#lights().
	class Light < Target
		# bridge - The Bridge that controls this light.
		# id - The bulb number.
		# info - Parsed Hash of the JSON light info object from the bridge.
		def initialize(bridge, id, info=nil)
			super bridge, id, info, :lights, 'state'
		end

		# "Light: [ID]: [name] ([type])"
		def to_s
			"Light: #{@id}: #{@name} (#{@type})"
		end
	end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nlhue-0.2.0 lib/nlhue/light.rb
nlhue-0.1.3 lib/nlhue/light.rb
nlhue-0.1.2 lib/nlhue/light.rb
nlhue-0.1.1 lib/nlhue/light.rb