# 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.
```sh
$ indicator-cli <led_index> --effect <effect_num> --rgb <rgb tuple>
```
Example:
```sh
$ indicator-cli 4 --effect 2 --rgb 0 0 255
```
Print LED and effect codes:
```sh
$ indicator-cli --list
```
## Library Usage
```python
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!
<a href="https://www.buymeacoffee.com/darkxst" target="_blank"><img src="img/blue-button.png" alt="Buy Me A Coffee" height="41" width="174"></a>
Raw data
{
"_id": null,
"home_page": "https://github.com/darkxst/yc1175-indicator",
"name": "yc1175-indicator",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "yc11752,ihost,indicator",
"author": "Tim Lunn",
"author_email": "tim@feathertop.org",
"download_url": "https://files.pythonhosted.org/packages/79/72/f90a2f0e000334cd9e7c086ba797c5cf64bc41ad115405a562b3efdcfda8/yc1175_indicator-0.1.1.tar.gz",
"platform": null,
"description": "# YC1175 Indicator - Sonoff iHost\n\nA library that implements the serial protocol for communication with the\nindicator module on the Sonoff iHost. This module controls the 4 buttons\nand the main RGB indicator.\n\n**WARNING: This is only useful if you have flashed linux or HAOS on your iHost.**\n\n## Installation\n\n`pip install yc1175-indicator`\n\n\n## CLI Usage\nFor convience you can control the LED's from the CLI wrapper. \n```sh\n$ indicator-cli <led_index> --effect <effect_num> --rgb <rgb tuple>\n```\n\nExample: \n```sh\n$ indicator-cli 4 --effect 2 --rgb 0 0 255\n```\n\nPrint LED and effect codes:\n```sh\n$ indicator-cli --list\n```\n\n\n## Library Usage\n```python\nimport asyncio\nfrom yc1175_indicator import indicator\n\nasync def test_callback(idx, event):\n print(f\"Button press: {idx}, type: {event}\")\n\nasync def main():\n my_yc = indicator.HassAPI()\n await my_yc.setup()\n my_yc.register_event_callback(test_callback)\n\n rgb = (0,0,255)\n yc.light_on(4, 1, rgb)\n try:\n # wait for button press\n await asyncio.sleep(30)\n except asyncio.CancelledError:\n pass\n yc.light_off(4)\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n```\n\n## Support\n\nIf you would like to help support further development of my `HAOS for iHost` project consider buying me a coffee!\n\n<a href=\"https://www.buymeacoffee.com/darkxst\" target=\"_blank\"><img src=\"img/blue-button.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"></a>\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A library to control the yc1175 indicator in Sonoff iHost",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/darkxst/yc1175-indicator",
"Repository": "https://github.com/darkxst/yc1175-indicator"
},
"split_keywords": [
"yc11752",
"ihost",
"indicator"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e7726eae849fbca41622d1862d7a31a71451052b256ab4a774dc07004a37ef7b",
"md5": "ee49dd483fed0d678745414a5f59d85e",
"sha256": "2810fb899d4178ad7d87acf94223e02efc74125d7eb097f4bbdab0f28ad916b3"
},
"downloads": -1,
"filename": "yc1175_indicator-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ee49dd483fed0d678745414a5f59d85e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 7445,
"upload_time": "2023-11-23T11:43:38",
"upload_time_iso_8601": "2023-11-23T11:43:38.116224Z",
"url": "https://files.pythonhosted.org/packages/e7/72/6eae849fbca41622d1862d7a31a71451052b256ab4a774dc07004a37ef7b/yc1175_indicator-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7972f90a2f0e000334cd9e7c086ba797c5cf64bc41ad115405a562b3efdcfda8",
"md5": "90f3eaf0e30cd659a47215ed0423eb0b",
"sha256": "26031d99a0be22a38e24dc5b112e8dde0279b063a472b9db1a446d94693fe780"
},
"downloads": -1,
"filename": "yc1175_indicator-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "90f3eaf0e30cd659a47215ed0423eb0b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 5798,
"upload_time": "2023-11-23T11:43:41",
"upload_time_iso_8601": "2023-11-23T11:43:41.862698Z",
"url": "https://files.pythonhosted.org/packages/79/72/f90a2f0e000334cd9e7c086ba797c5cf64bc41ad115405a562b3efdcfda8/yc1175_indicator-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-23 11:43:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "darkxst",
"github_project": "yc1175-indicator",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "yc1175-indicator"
}