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 <index> --effect <effect> --rgb <rgb tuple>
example:
indicator-cli 4 --effect 2 --rgb 0 0 255
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())
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
yc1175_indicator-0.1.0.tar.gz
(5.5 kB
view hashes)
Built Distribution
Close
Hashes for yc1175_indicator-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ba8d3279832764501d89cace2605f0a443ad4e064071986a0b3384a613131e5 |
|
MD5 | b3972ef86c77c75d48302279657c854f |
|
BLAKE2b-256 | f8e17044602a4eea6f59743be42dbb7a8edb47d3c7b5149e45bd573216a751af |