light_me_up 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 688aabf9941a66f6b62daec899c4e6c77c421563e45c8df26c481502374b9042
4
+ data.tar.gz: 6dfd7e53a8a049f153316e9451eb90296d3a38ab22edd4d85e33321e83390e76
5
+ SHA512:
6
+ metadata.gz: 1f641adc33d6c662012a307cb6c0127c9f68f00df01aa187e270c1e332895759654de4d5656bd842157ca27ec31a493a3c3be32336c852efbc8f6fe4db9aa613
7
+ data.tar.gz: afac7f5d08f6e1b8defdf64fce32d92e89132aac1399c309b2947324c51451ff06349520eba12dd4829fd54cc24d8a4ea1bb62eab8f57c595f0fb73d5196ea64
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2021-12-23
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at peter@petermccracken.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in light_me_up.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "minitest", "~> 5.0"
11
+
12
+ gem "rubocop", "~> 1.21"
data/Gemfile.lock ADDED
@@ -0,0 +1,42 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ light_me_up (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.2)
10
+ minitest (5.15.0)
11
+ parallel (1.21.0)
12
+ parser (3.0.3.2)
13
+ ast (~> 2.4.1)
14
+ rainbow (3.0.0)
15
+ rake (13.0.6)
16
+ regexp_parser (2.2.0)
17
+ rexml (3.2.5)
18
+ rubocop (1.24.0)
19
+ parallel (~> 1.10)
20
+ parser (>= 3.0.0.0)
21
+ rainbow (>= 2.2.2, < 4.0)
22
+ regexp_parser (>= 1.8, < 3.0)
23
+ rexml
24
+ rubocop-ast (>= 1.15.0, < 2.0)
25
+ ruby-progressbar (~> 1.7)
26
+ unicode-display_width (>= 1.4.0, < 3.0)
27
+ rubocop-ast (1.15.0)
28
+ parser (>= 3.0.1.1)
29
+ ruby-progressbar (1.11.0)
30
+ unicode-display_width (2.1.0)
31
+
32
+ PLATFORMS
33
+ arm64-darwin-21
34
+
35
+ DEPENDENCIES
36
+ light_me_up!
37
+ minitest (~> 5.0)
38
+ rake (~> 13.0)
39
+ rubocop (~> 1.21)
40
+
41
+ BUNDLED WITH
42
+ 2.2.32
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Peter McCracken
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # LightMeUp
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/light_me_up`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'light_me_up'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install light_me_up
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/peterjm/light_me_up. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/peterjm/light_me_up/blob/master/CODE_OF_CONDUCT.md).
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the LightMeUp project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/peterjm/light_me_up/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/*_test.rb"]
10
+ end
11
+
12
+ require "rubocop/rake_task"
13
+
14
+ RuboCop::RakeTask.new
15
+
16
+ task default: %i[test rubocop]
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "light_me_up"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/light-me-up ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative "../lib/light_me_up"
4
+
5
+ parser = LightMeUp::OptionParser.new(
6
+ program_name: File.basename(__FILE__),
7
+ starting_options: {
8
+ ip_address: ENV["ELGATO_IP_ADDRESS"],
9
+ },
10
+ default_settings: {
11
+ brightness: ENV["ELGATO_DEFAULT_BRIGHTNESS"].to_i,
12
+ temperature: ENV["ELGATO_DEFAULT_TEMPERATURE"].to_i,
13
+ }
14
+ )
15
+
16
+ options = parser.parse(ARGV)
17
+ api_client = LightMeUp::ApiClient.new(ip_address: options[:ip_address])
18
+ success = LightMeUp::SettingsUpdate.new(api_client, options, parser.help_message).perform
19
+ exit 1 unless success
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,135 @@
1
+ require 'net/http'
2
+ require 'json'
3
+
4
+ module LightMeUp
5
+ class ApiClient
6
+ DEFAULT_PORT = 9123
7
+ LIGHTS_PATH = "/elgato/lights"
8
+ OPEN_TIMEOUT = 1 # seconds
9
+ READ_TIMEOUT = 1 # seconds
10
+
11
+ def initialize(ip_address:, port: DEFAULT_PORT)
12
+ raise Error, "No ip_address specified." unless ip_address && ip_address != ""
13
+ @ip_address = ip_address
14
+ @port = port
15
+ end
16
+
17
+ def status
18
+ response = get(lights_uri)
19
+ LightSerializer.deserialize(response).first
20
+ end
21
+
22
+ def toggle
23
+ with_connection do |http|
24
+ current_status = status
25
+
26
+ if current_status.on
27
+ turn_light_off
28
+ else
29
+ turn_light_on
30
+ end
31
+ end
32
+ end
33
+
34
+ def set(on: nil, brightness: nil, temperature: nil)
35
+ update_light(Light.new(on: on, brightness: brightness, temperature: temperature))
36
+ end
37
+
38
+ def turn_light_on
39
+ set(on: true)
40
+ end
41
+
42
+ def turn_light_off
43
+ set(on: false)
44
+ end
45
+
46
+ def set_brightness(brightness)
47
+ set(brightness: brightness)
48
+ end
49
+
50
+ def set_temperature(temperature)
51
+ set(temperature: temperature)
52
+ end
53
+
54
+ private
55
+
56
+ attr_reader :ip_address, :port, :connection
57
+
58
+ def lights_uri
59
+ URI::HTTP.build(host: ip_address, port: port, path: LIGHTS_PATH)
60
+ end
61
+
62
+ def update_light(settings)
63
+ response = put(lights_uri, build_light_configuration_data([settings]))
64
+ LightSerializer.deserialize(response).first
65
+ end
66
+
67
+ def build_light_configuration_data(lights)
68
+ {
69
+ numberOfLights: lights.size,
70
+ lights: lights.map { |l| LightSerializer.serialize(l) }
71
+ }
72
+ end
73
+
74
+ def get(uri)
75
+ perform_request(:get, uri)
76
+ end
77
+
78
+ def put(uri, data = {})
79
+ perform_request(:put, uri) do |request|
80
+ request.body = data.to_json
81
+ end
82
+ end
83
+
84
+ def connected?
85
+ !!@connection
86
+ end
87
+
88
+ def with_connection
89
+ Net::HTTP.start(ip_address, port, open_timeout: OPEN_TIMEOUT, read_timeout: READ_TIMEOUT) do |connection|
90
+ @connection = connection
91
+ yield
92
+ end
93
+ rescue Errno::EHOSTDOWN, Net::OpenTimeout
94
+ raise Error, "Couldn't connect to lights."
95
+ ensure
96
+ @connection = nil
97
+ end
98
+
99
+ def perform_request(method, uri, &block)
100
+ if connected?
101
+ perform_request_with_connection(method, uri, &block)
102
+ else
103
+ with_connection do
104
+ perform_request_with_connection(method, uri, &block)
105
+ end
106
+ end
107
+ end
108
+
109
+ def perform_request_with_connection(method, uri, &block)
110
+ request = build_request(method, uri)
111
+ request['Content-Type'] = "application/json"
112
+ block.call(request) if block_given?
113
+ response = connection.request(request)
114
+
115
+ case response
116
+ when Net::HTTPSuccess
117
+ JSON.parse(response.body)
118
+ else
119
+ raise Error, response.body
120
+ end
121
+
122
+ end
123
+
124
+ def build_request(method, uri)
125
+ case method
126
+ when :get
127
+ Net::HTTP::Get.new(uri)
128
+ when :put
129
+ Net::HTTP::Put.new(uri)
130
+ else
131
+ raise ArgumentError, "unhandled method type: #{method}"
132
+ end
133
+ end
134
+ end
135
+ end
@@ -0,0 +1,4 @@
1
+ module LightMeUp
2
+ class Error < StandardError
3
+ end
4
+ end
@@ -0,0 +1,51 @@
1
+ module LightMeUp
2
+ class Light
3
+ attr_reader :on, :brightness, :temperature
4
+
5
+ BRIGHTNESS_RANGE = (0..100)
6
+ TEMPERATURE_RANGE = (143..344)
7
+
8
+ class << self
9
+ def max_brightness
10
+ BRIGHTNESS_RANGE.last
11
+ end
12
+
13
+ def min_brightness
14
+ BRIGHTNESS_RANGE.first
15
+ end
16
+
17
+ def max_temperature
18
+ TEMPERATURE_RANGE.last
19
+ end
20
+
21
+ def min_temperature
22
+ TEMPERATURE_RANGE.first
23
+ end
24
+ end
25
+
26
+ def initialize(on: nil, brightness: nil, temperature: nil)
27
+ validate_brightness(brightness)
28
+ validate_temperature(temperature)
29
+
30
+ @on = on
31
+ @brightness = brightness
32
+ @temperature = temperature
33
+ end
34
+
35
+ private
36
+
37
+ def validate_brightness(value)
38
+ validate_range(value, BRIGHTNESS_RANGE, "Brightness")
39
+ end
40
+
41
+ def validate_temperature(value)
42
+ validate_range(value, TEMPERATURE_RANGE, "Temperature")
43
+ end
44
+
45
+ def validate_range(value, range, name)
46
+ return if value.nil?
47
+ return if range.include?(value)
48
+ raise Error, "#{name} must be between #{range.first} and #{range.last}"
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,29 @@
1
+ module LightMeUp
2
+ class LightSerializer
3
+ class << self
4
+ def serialize(light)
5
+ on_as_int = if light.on.nil?
6
+ nil
7
+ else
8
+ light.on ? 1 : 0
9
+ end
10
+
11
+ {
12
+ on: on_as_int,
13
+ brightness: light.brightness,
14
+ temperature: light.temperature,
15
+ }.compact
16
+ end
17
+
18
+ def deserialize(json)
19
+ json["lights"].map do |light|
20
+ Light.new(
21
+ on: light["on"] == 1,
22
+ brightness: light["brightness"],
23
+ temperature: light["temperature"],
24
+ )
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,75 @@
1
+ require 'optparse'
2
+
3
+ module LightMeUp
4
+ class OptionParser
5
+ MESSAGES = {
6
+ help: "Prints this help message",
7
+ toggle: "Toggle whether the lights are on or off",
8
+ on: "Turn the light on",
9
+ off: "Turn the light off",
10
+ ip_address: "Specify the IP address",
11
+ defaults: "Set to default values",
12
+ brightness: "Set the brightness (%d to %d)" %
13
+ [LightMeUp::Light.min_brightness, LightMeUp::Light.max_brightness],
14
+ temperature: "Set the temperature (%d to %d)" %
15
+ [LightMeUp::Light.min_temperature, LightMeUp::Light.max_temperature],
16
+ }
17
+
18
+ attr_reader :program_name, :options, :default_settings
19
+
20
+ def initialize(program_name:, starting_options:, default_settings:)
21
+ @program_name = program_name
22
+ @options = starting_options.dup
23
+ @default_settings = default_settings.dup
24
+ end
25
+
26
+ def parse(input_options)
27
+ parser.parse!(input_options)
28
+ options
29
+ end
30
+
31
+ def help_message
32
+ parser.to_s
33
+ end
34
+
35
+ private
36
+
37
+ def parser
38
+ @parser ||= ::OptionParser.new do |opts|
39
+ opts.banner = "Usage: #{program_name} [options]"
40
+
41
+ opts.on("-h", "--help", MESSAGES[:help]) do
42
+ options[:help] = true
43
+ end
44
+
45
+ opts.on("-T", "--toggle", MESSAGES[:toggle]) do
46
+ options[:toggle] = true
47
+ end
48
+
49
+ opts.on("-o", "--on", MESSAGES[:on]) do
50
+ options[:on] = true
51
+ end
52
+
53
+ opts.on("-O", "--off", MESSAGES[:off]) do
54
+ options[:on] = false
55
+ end
56
+
57
+ opts.on("-i", "--ip-address=IP_ADDRESS", MESSAGES[:ip_address]) do |ip_address|
58
+ options[:ip_address] = ip_address
59
+ end
60
+
61
+ opts.on("-d", "--defaults", MESSAGES[:defaults]) do
62
+ options.merge!(default_settings)
63
+ end
64
+
65
+ opts.on("-bBRIGHTNESS", "--brightness=BRIGHTNESS", MESSAGES[:brightness]) do |brightness|
66
+ options[:brightness] = brightness.to_i
67
+ end
68
+
69
+ opts.on("-tTEMPERATURE", "--temperature=TEMPERATURE", MESSAGES[:temperature]) do |temperature|
70
+ options[:temperature] = temperature.to_i
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,48 @@
1
+ module LightMeUp
2
+ class SettingsUpdate
3
+ attr_reader :api_client, :options, :help_message, :output_stream, :error_output_stream
4
+
5
+ def initialize(api_client, options, help_message, output_stream=STDOUT, error_output_stream=STDERR)
6
+ @api_client = api_client
7
+ @options = options
8
+ @help_message = help_message
9
+ @output_stream = output_stream
10
+ @error_output_stream = error_output_stream
11
+ end
12
+
13
+ def perform
14
+ if options[:help]
15
+ puts parser.help_message
16
+ return true
17
+ end
18
+
19
+ if options[:toggle]
20
+ if settings_options.any?
21
+ error_output_stream.puts "Toggle is not compatible with setting other options."
22
+ output_stream.puts help_message
23
+ return false
24
+ end
25
+
26
+ api_client.toggle
27
+ return true
28
+ end
29
+
30
+ if settings_options.any?
31
+ api_client.set(**settings_options)
32
+ return true
33
+ end
34
+
35
+ output_stream.puts help_message
36
+ return false
37
+ rescue LightMeUp::Error => e
38
+ error_output_stream.puts e.message
39
+ return false
40
+ end
41
+
42
+ private
43
+
44
+ def settings_options
45
+ @settings_options ||= options.slice(:on, :brightness, :temperature)
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module LightMeUp
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "light_me_up/version"
4
+ require_relative "light_me_up/error"
5
+ require_relative "light_me_up/light"
6
+ require_relative "light_me_up/light_serializer"
7
+ require_relative "light_me_up/option_parser"
8
+ require_relative "light_me_up/settings_update"
9
+ require_relative "light_me_up/api_client"
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: light_me_up
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Peter McCracken
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-12-25 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Provides the ability to turn on and off, and adjust brightness and temperature,
14
+ on a key light.
15
+ email:
16
+ - peter@petermccracken.com
17
+ executables:
18
+ - light-me-up
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - ".rubocop.yml"
23
+ - CHANGELOG.md
24
+ - CODE_OF_CONDUCT.md
25
+ - Gemfile
26
+ - Gemfile.lock
27
+ - LICENSE.txt
28
+ - README.md
29
+ - Rakefile
30
+ - bin/console
31
+ - bin/light-me-up
32
+ - bin/setup
33
+ - lib/light_me_up.rb
34
+ - lib/light_me_up/api_client.rb
35
+ - lib/light_me_up/error.rb
36
+ - lib/light_me_up/light.rb
37
+ - lib/light_me_up/light_serializer.rb
38
+ - lib/light_me_up/option_parser.rb
39
+ - lib/light_me_up/settings_update.rb
40
+ - lib/light_me_up/version.rb
41
+ homepage: https://github.com/peterjm/light_me_up
42
+ licenses:
43
+ - MIT
44
+ metadata:
45
+ homepage_uri: https://github.com/peterjm/light_me_up
46
+ source_code_uri: https://github.com/peterjm/light_me_up
47
+ changelog_uri: https://github.com/peterjm/light_me_up/CHANGELOG.md
48
+ post_install_message:
49
+ rdoc_options: []
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 2.6.0
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ requirements: []
63
+ rubygems_version: 3.2.32
64
+ signing_key:
65
+ specification_version: 4
66
+ summary: Command line control for a brand name key light.
67
+ test_files: []