跳转到主要内容

从Raspberry Pi远程控制电源插座

项目描述

Python模块,用于控制Energenie附加板,该板用于Raspberry Pi,可远程开关电源插座。

安装

在Raspberry Pi上,使用pip安装energenie模块。

Python 3

sudo apt-get install python3-pip
sudo pip-3.2 install energenie

Python 2

sudo apt-get install python-pip
sudo pip install energenie

用法

示例用法

from energenie import switch_on, switch_off
from time import sleep

# turn all plug sockets on and off
switch_on()
switch_off()

# turn a plug socket on and off by number
switch_on(1)
switch_off(1)

switch_on(3)
switch_off(3)

# turn some plug sockets on, then turn them off after 10 seconds
switch_on(1)
switch_on(4)
sleep(10)
switch_off(1)
switch_off(4)

贡献者

开源

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解更多关于安装包的信息。

源分布

energenie-1.0.1.tar.gz (47.7 kB 查看散列)

上传时间:

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面