{"id":20967073,"url":"https://github.com/tsaohucn/insnergy-api-ruby-client","last_synced_at":"2025-03-13T07:41:32.399Z","repository":{"id":56877714,"uuid":"68189192","full_name":"tsaohucn/insnergy-api-ruby-client","owner":"tsaohucn","description":"A ruby wrapper for the insnergy API","archived":false,"fork":false,"pushed_at":"2017-04-17T18:07:30.000Z","size":44,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-04T21:05:40.219Z","etag":null,"topics":["api-wrapper","insnergy","ruby","sdk"],"latest_commit_sha":null,"homepage":"https://www.insnergy.com/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tsaohucn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-14T08:41:40.000Z","updated_at":"2017-12-13T15:54:15.000Z","dependencies_parsed_at":"2022-08-20T23:10:09.719Z","dependency_job_id":null,"html_url":"https://github.com/tsaohucn/insnergy-api-ruby-client","commit_stats":null,"previous_names":["kaogaau/insnergy-api-ruby-client"],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsaohucn%2Finsnergy-api-ruby-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsaohucn%2Finsnergy-api-ruby-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsaohucn%2Finsnergy-api-ruby-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsaohucn%2Finsnergy-api-ruby-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsaohucn","download_url":"https://codeload.github.com/tsaohucn/insnergy-api-ruby-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243364956,"owners_count":20279211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-wrapper","insnergy","ruby","sdk"],"created_at":"2024-11-19T03:01:27.487Z","updated_at":"2025-03-13T07:41:32.381Z","avatar_url":"https://github.com/tsaohucn.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Insnergy 智慧綠能聯網共通平台\n\nA ruby wrapper for the insnergy API \u003chttps://www.insnergy.com/\u003e\n\n[![Build Status](https://travis-ci.org/tsaohucn/insnergy-api-ruby-client.svg?branch=master)](https://travis-ci.org/tsaohucn/insnergy-api-ruby-client)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'insnergy-api-ruby-client'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install insnergy-api-ruby-client\n\n## Usage\nYou can get the insnergy client by this way\n\n```ruby\nclient = Insnergy::Client::Token.new(domain: domain, oauth_key: oauth_key, oauth_secert: oauth_secret, refresh_token: refresh_token) \n```\n\nThen you can get `access_token`, `expires_at`\n\n```ruby\nclient.access_token #=\u003e34092c6d-7548-4c7f-9ede-12a845c4b97\nclient.expires_at #=\u003e '2017-01-01 10:00:00'\n```\nNow, you can use the client that's unexpired to do something like `control device` `get widgets infomation` `get power compution`\n\n```ruby\nInsnergy::Client::Control.new(client: unexpired_client, device_id: 'RS06000D6F0003BB8B88', action: 'on')\n\nInsnergy::Client::Widgets.new(client: unexpired_client, category: 'outlet')\n\nInsnergy::Client::Power.new(client: unexpired_client, device_ids:['RS06000D6F0003BB8B88','...',...], start_time: this_month_day1, end_time: next_month_day1)\n```\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo 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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/insnergy-api-ruby-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.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsaohucn%2Finsnergy-api-ruby-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsaohucn%2Finsnergy-api-ruby-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsaohucn%2Finsnergy-api-ruby-client/lists"}