这个小脚本(守护进程)将轮询max-cube系统已知的所有窗口传感器的状态,并检查打开的窗口
maxwindownotif的Python项目详细描述
这个小脚本(守护进程)将轮询所有窗口的状态 max-cube系统(http://www.eq-3.de)已知的传感器,并检查 打开窗户。
然后它会使用 打开天气图(http://openweathermap.org),如果温度是 在低于指定阈值时,它将使用 通知程序插件。
现在唯一可用的通知插件是使用pushover服务 (https://pushover.net)向移动电话发送通知。
它是通过提醒你关闭你的 通风后的窗户。
安装
可以使用pip安装max open window notifier
sudo pip install maxwindownotify
使用量
您可以使用cli help函数获取有关如何启动 守护进程,以及可用的选项:
$ maxwindownotify --help usage: maxwindownotify.py [-h][-i INTERVAL][-n NETWORK][-c CITY][-t THRESHOLD] -k OWMAPPID [-s][-u USER][-p TOKEN][-v] This deamon polls the MAX Cube for all window status. If a window is open longer than twice the poll interval a notification will be sent using the notifier plugin optional arguments: -h, --help show this help message and exit -i INTERVAL, --interval INTERVAL polling interval in minutes (default 30 minutes) -n NETWORK, --network NETWORK Network Address to send search broadcast for MAX Cube (default 192.168.178.0/24) -c CITY, --city CITY the city name or code in OpenWeatherMap to retrieve the outside temperature from (default Munich, Germany) -t THRESHOLD, --threshold THRESHOLD the temperature threshold for suppressing notifications (default: 12C) -k OWMAPPID, --owmappid OWMAPPID the API Key (APPID) to authenticate with Open Weather Map -s, --simulation randomly simulate open windows -u USER, --user USER the username (or user key) used for the notifier module -p TOKEN, --token TOKEN the password (or app token) used for the notifier module -v, --verbose increase output verbosity As an alternative to the commandline, params can be placed in a file, one per line, and specified on the commandline like 'maxwindownotify.py @params.conf'.
示例:
maxwindownotify -k 82k4v1b99s41212e5bf5490432bb89f4 -u abcCKnM9uYhjng3kLV6czGFUsmZ76D -p ahxYZcjhXT6P5zDt265LGyuLVaDQNx -i 15 -c Berlin -t 8