Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nigelramsay/wemo
An Elixir package for discovering and controlling Belkin Wemo devices
https://github.com/nigelramsay/wemo
belkin elixir wemo wemo-switch
Last synced: 2 months ago
JSON representation
An Elixir package for discovering and controlling Belkin Wemo devices
- Host: GitHub
- URL: https://github.com/nigelramsay/wemo
- Owner: nigelramsay
- Created: 2017-05-20T02:47:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-22T09:23:15.000Z (over 7 years ago)
- Last Synced: 2024-09-28T17:20:55.856Z (3 months ago)
- Topics: belkin, elixir, wemo, wemo-switch
- Language: Elixir
- Size: 44.9 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Wemo
Elixir package for discovering and controlling Belkin Wemo devices.
[![Build Status](https://travis-ci.org/nigelramsay/wemo.svg?branch=master)](https://travis-ci.org/nigelramsay/wemo)
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `wemo` to your list of dependencies in `mix.exs`:```elixir
def deps do
[{:wemo, "~> 0.1.0"}]
end
```## Usage examples
Searching for a specific switch:
```elixir-lang
Wemo.Switch.find_by_name("Laundry") |> Switch.status
=> {:ok, 1}
```Turning a switch on and off:
```elixir-lang
living_room = Wemo.Switch.find_by_name("Living Room")
Switch.on(living_room)
=> {:ok, 1}Switch.off(living_room)
=> {:ok, 0}
```Checking the status of a switch:
```elixir-lang
Wemo.Switch.on?(living_room)
=> trueWemo.Switch.off?(living_room)
=> trueWemo.Switch.status(living_room)
=> 1
```