Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lmelvin/pyihome
Python library to interface with iHome API.
https://github.com/lmelvin/pyihome
python python3
Last synced: 2 days ago
JSON representation
Python library to interface with iHome API.
- Host: GitHub
- URL: https://github.com/lmelvin/pyihome
- Owner: lmelvin
- License: mit
- Created: 2018-05-26T05:38:53.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-23T19:53:14.000Z (about 6 years ago)
- Last Synced: 2024-10-10T12:49:12.561Z (about 1 month ago)
- Topics: python, python3
- Language: Python
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyihome
Python library to interface with the iHome API.
This library interfaces with the [EVRYTHING API](https://developers.evrythng.com/reference)
How to use
```python
from pyihome import PyiHome# init api
api = PyiHome("username", "password")# get ALL devices
# note this is a json object
devices = api.devices# get ALL switches
switches = api.switches# work with a single switch
switch = switches[0]# turn on the switch
switch.turn_on()# turn off the switch
switch.turn_off()
```### Switch
**Properties**
| Property | Type |
| ------------- |:------------- |
| name | str |
| id | str |**Methods**
| Method | Params | Return Type | Description |
| ------------- | ------------- | ----------- | ------------------------------------------------------- |
| turn_on() | | None | Turns the switch on |
| turn_off() | | None | Turns the switch off |
| get_state() | | int | Gets the current state of the switch. 1 is on, 0 is off |