跳转到主要内容

Quby ToonAPI的异步Python客户端。

项目描述

Python: Quby ToonAPI的异步Python客户端

GitHub Release Project Stage Project Maintenance License

Build Status Code Coverage Code Quality

Sponsor Frenck via GitHub Sponsors

Support Frenck on Patreon

Quby ToonAPI的异步Python客户端。

关于

用于控制Quby恒温器的Qubby ToonAPI的异步Python客户端。

这些恒温器也以以下名称出售

  • Eneco Toon
  • Engie Electrabel Boxx
  • Viesgo

它们都使用相同的API端点,因此可以使用此库。

此库创建是为了支持Home Assistant的集成。

安装

pip install toonapi

使用

import asyncio

from toonapi import Toon


async def main():
    """Show example on using the ToonAPI."""
    async with Toon(token="put-in-token-here") as toon:
        agreements = await toon.agreements()
        print(agreements)

        await toon.activate_agreement(agreement=agreements[0])

        status = await toon.update()
        print(status.gas_usage)
        print(status.thermostat)
        print(status.power_usage)


if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

变更日志 & 发布

此存储库使用GitHub的发布功能维护变更日志。日志的格式基于Keep a Changelog

发布基于语义化版本,并使用MAJOR.MINOR.PATCH格式。简而言之,版本将根据以下规则递增

  • MAJOR:不兼容或重大更改。
  • MINOR:向后兼容的新功能和增强。
  • PATCH:向后兼容的错误修复和包更新。

贡献

这是一个活跃的开源项目。我们始终欢迎那些希望使用代码或为其做出贡献的人。

我们为我们的贡献指南创建了一个单独的文档。

感谢您的参与! :heart_eyes

设置开发环境

如果您想做出贡献,已包含一个Makefile以确保快速开始。

make venv
source ./venv/bin/activate
make dev

现在您可以开始开发了,运行不带参数的make以获得所有可用make目标(包括描述)的概述

$ make
Asynchronous Python client for the Quby ToonAPI.

Usage:
  make help                            Shows this message.
  make dev                             Set up a development environment.
  make lint                            Run all linters.
  make lint-black                      Run linting using black & blacken-docs.
  make lint-flake8                     Run linting using flake8 (pycodestyle/pydocstyle).
  make lint-pylint                     Run linting using PyLint.
  make lint-mypy                       Run linting using MyPy.
  make test                            Run tests quickly with the default Python.
  make coverage                        Check code coverage quickly with the default Python.
  make install                         Install the package to the active Python's site-packages.
  make clean                           Removes build, test, coverage and Python artifacts.
  make clean-all                       Removes all venv, build, test, coverage and Python artifacts.
  make clean-build                     Removes build artifacts.
  make clean-pyc                       Removes Python file artifacts.
  make clean-test                      Removes test and coverage artifacts.
  make clean-venv                      Removes Python virtual environment artifacts.
  make dist                            Builds source and wheel package.
  make release                         Release build on PyP
  make venv                            Create Python venv environment.

作者 & 贡献者

此存储库的原始设置由Franck Nijhof完成。

要查看所有作者和贡献者的完整列表,请检查贡献者页面

许可证

MIT许可证

版权所有 (c) 2020 Franck Nijhof

特此授予任何获得此软件和相关文档副本(“软件”)的人免费使用、复制、修改、合并、发布、分发、再许可和/或出售软件副本的权利,并允许向软件提供副本的人这样做,但必须遵守以下条件

上述版权声明和本许可声明应包含在软件的所有副本或主要部分中。

软件按“原样”提供,不提供任何形式的保证,无论是明示的、暗示的,还是关于适销性、特定目的适用性或不侵犯的保证。在任何情况下,作者或版权持有人均不对任何索赔、损害或其他责任负责,无论是基于合同、侵权或其他方式,由此软件或其使用或其他方式产生、产生于或与此软件相关。

项目详情


下载文件

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

源分发

toonapi-0.3.0.tar.gz (13.9 kB 查看哈希值)

上传时间:

构建分发

toonapi-0.3.0-py3-none-any.whl (12.0 kB 查看哈希值)

上传时间: Python 3

由以下支持

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