https://github.com/davydovanton/yeelight-lamp-client
Ruby client for yeelight lamps
https://github.com/davydovanton/yeelight-lamp-client
Last synced: 3 months ago
JSON representation
Ruby client for yeelight lamps
- Host: GitHub
- URL: https://github.com/davydovanton/yeelight-lamp-client
- Owner: davydovanton
- License: mit
- Created: 2018-01-02T12:05:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-03-03T09:59:46.000Z (over 5 years ago)
- Last Synced: 2024-04-25T21:06:33.254Z (about 1 year ago)
- Language: Ruby
- Size: 13.7 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Yeelight::Lamp::Client
Simple client for Yeelight lamps
Inspired by:
https://github.com/nunows/Yeelight-Wifi## Installation
Add this line to your application's Gemfile:
```ruby
gem 'yeelight-lamp-client'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install yeelight-lamp-client
## Usage
```ruby
require_relative './lib/yeelight'# Use your lamp's IP address
LAMP_IP_ADDRESS = '192.168.0.1'
# Provide Hex Values
GREEN = '00FF00'
RED = 'FF0000'client = Yeelight::Client.new(LAMP_IP_ADDRESS, 55443)
client.get_prop('"ct"') # => JSON with propslamp = Yeelight::Lamp.new(client)
lamp.toggle_color(GREEN, 2)
sleep 1
lamp.toggle_color(RED, 2)
```## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/davydovanton/yeelight-lamp-client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
## Code of Conduct
Everyone interacting in the Yeelight::Lamp::Client project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/yeelight-lamp-client/blob/master/CODE_OF_CONDUCT.md).