A library to control the yc1175 indicator in Sonoff iHost
Project description
YC1175 Indicator - Sonoff iHost
A library that implements the serial protocol for communication with the indicator module on the Sonoff iHost. This module controls the 4 buttons and the main RGB indicator.
WARNING: This is only useful if you have flashed linux or HAOS on your iHost.
Installation
pip install yc1175-indicator
CLI Usage
For convience you can control the LED's from the CLI wrapper.
$ indicator-cli <led_index> --effect <effect_num> --rgb <rgb tuple>
Example:
$ indicator-cli 4 --effect 2 --rgb 0 0 255
Print LED and effect codes:
$ indicator-cli --list
Library Usage
import asyncio
from yc1175_indicator import indicator
async def test_callback(idx, event):
print(f"Button press: {idx}, type: {event}")
async def main():
my_yc = indicator.HassAPI()
await my_yc.setup()
my_yc.register_event_callback(test_callback)
rgb = (0,0,255)
yc.light_on(4, 1, rgb)
try:
# wait for button press
await asyncio.sleep(30)
except asyncio.CancelledError:
pass
yc.light_off(4)
if __name__ == "__main__":
asyncio.run(main())
Support
If you would like to help support further development of my HAOS for iHost project consider buying me a coffee!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yc1175_indicator-0.1.1.tar.gz.
File metadata
- Download URL: yc1175_indicator-0.1.1.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26031d99a0be22a38e24dc5b112e8dde0279b063a472b9db1a446d94693fe780
|
|
| MD5 |
90f3eaf0e30cd659a47215ed0423eb0b
|
|
| BLAKE2b-256 |
7972f90a2f0e000334cd9e7c086ba797c5cf64bc41ad115405a562b3efdcfda8
|
File details
Details for the file yc1175_indicator-0.1.1-py3-none-any.whl.
File metadata
- Download URL: yc1175_indicator-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2810fb899d4178ad7d87acf94223e02efc74125d7eb097f4bbdab0f28ad916b3
|
|
| MD5 |
ee49dd483fed0d678745414a5f59d85e
|
|
| BLAKE2b-256 |
e7726eae849fbca41622d1862d7a31a71451052b256ab4a774dc07004a37ef7b
|