# asyncio-orvibo
Control Orvibo devices with Python 3 using asyncio (single threaded with event loop). Currently supports the S20 WiFi Smart Switch and AllOne IR.
## Usage
```python
from asyncio_orvibo import s20
import asyncio
import traceback
async def test_switch_all_off_on():
dict_devices = await s20.S20.discovery()
for _,s in dict_devices.items():
if await s.state_change(0):
print("State off OK %s",s)
else:
print("State off FAIL %s",s)
await asyncio.sleep(5)
for _,s in dict_devices.items():
if await s.state_change(1):
print("State on OK %s",s)
else:
print("State on FAIL %s",s)
loop = asyncio.get_event_loop()
try:
loop.run_until_complete(test_switch_all_off_on())
except:
traceback.print_exc()
################################################
from asyncio_orvibo import allone
import asyncio
import traceback
import binascii
async def test_emit(k):
dict_devices = await allone.AllOne.discovery()
payload = binascii.unhexlify(k)
for _,a in dict_devices.items():
rv = await a.emit_ir(payload)
if rv:
print("Emit OK %s %s",a,binascii.hexlify(rv).decode('utf-8'))
else:
print("Emit failed")
loop = asyncio.get_event_loop()
try:
loop.run_until_complete(test_emit('00000000a801000000000000000098018e11951127029b0625029906270299062702380227023a0225023802270238022d023202270299062702990627029806270238022702380227023802270238022802370227023802270238022702980627023802240245021c02380227023802270238022702980627029c0623023802270298062702990627029b062502990627029906270220b7a1119d11270299062702990628029b06250238022702380227023802270238022702380227029906270299062702990627023802270238022a0234022702380227023802260238022702380226029a06260238022602380226023802260241021e02380227029b0624029906270238022702980627029b0625029906270299062702990629021db79f11a2112502990627029b0625029906270238022702380227023802270238022a02350227029906270299062702990628023702260238022702380227023802270238022702380226023b02240299062702380226023802270238022602380227023c0223029906270299062702380226029b062402990627029906270299062802980627020000'))
except:
traceback.print_exc()
```
## Contributions
Pull requests are welcome. Possible areas for improvement:
* Additional Orvibo devices (CT10 for example, I have reverse engineered this device I only need time to write the code).
* Expand S20 functions: Timers, configuration, etc
## Disclaimer
Not affiliated with Shenzhen Orvibo Electronics Co., Ltd.
PyPI 官网下载 | asyncio-orvibo-1.2.tar.gz
版权申诉
103 浏览量
2022-01-26
12:04:44
上传
评论
收藏 7KB GZ 举报
![avatar](https://profile-avatar.csdnimg.cn/277f6345dca0446498fbbc03843436aa_qq_38161040.jpg!1)
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
最新资源
- PHP代码,微信开发,微信支付
- 霍尼韦尔 空气净化器KJ820F 说明书
- 海信电视刷机数据 LED48K380U(0000)-C007 生产用软件数据 务必确认机编一致 强制刷机 整机USB升级程序
- PHP代码,物联网平台,门禁控制器
- WindowResizer_V1.00.jpg
- 瑞斯康达MSG-WR135编程器固件
- 单片机输出PWM案例.pdf
- python有趣的库pb06-flow-control.rar
- Java项目基于springboot+vue的毕业生求职招聘系统拥有学校、学生和企业三种角色(源码+数据库)zip
- Django开发博客(5)-配置models.py以及views.py
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)