python-bsblan


Namepython-bsblan JSON
Version 0.5.18 PyPI version JSON
download
home_pagehttps://github.com/liudger/python-bsblan
SummaryAsynchronous Python client for BSBLAN
upload_time2024-01-16 08:30:20
maintainerWillem-Jan van Rootselaar
docs_urlNone
authorWillem-Jan van Rootselaar
requires_python>=3.10,<4.0
licenseMIT
keywords bsblan thermostat client api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Python: BSBLan API Client

[![GitHub Release][releases-shield]][releases]
[![Python Versions][python-versions-shield]][pypi]
![Project Stage][project-stage-shield]
![Project Maintenance][maintenance-shield]
[![License][license-shield]](LICENSE.md)

[![Build Status][build-shield]][build]
[![Code Coverage][codecov-shield]][codecov]
[![Quality Gate Status][sonarcloud-shield]][sonarcloud]

[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee]

Asynchronous Python client for BSBLan.

## About

This package allows you to control and monitor an BSBLan device
programmatically. It is mainly created to allow third-party programs to automate
the behavior of [BSBLan][bsblanmodule].

## Installation

```bash
pip install python-bsblan
```

## Usage

```python
# pylint: disable=W0621
"""Asynchronous Python client for BSBLan."""

import asyncio

from bsblan import BSBLan, Info, State


async def main(loop):
    """Show example on controlling your BSBLan device.

    Options:
    - passkey (http://url/"passkey"/) if your device is setup for passkey authentication
    - username and password if your device is setup for username/password authentication

    """
    async with BSBLan(
        host="10.0.1.60", passkey=None, username=None, password=None, loop=loop
    ) as bsblan:
        # get state from bsblan device
        state: State = await bsblan.state()
        print(state)

        # set temp thermostat
        await bsblan.thermostat(target_temperature=19.0)

        # set hvac_mode (0-3) (protection,auto,reduced,comfort)
        await bsblan.thermostat(hvac_mode=3)

        # get some generic info from the heater
        info: Info = await bsblan.info()
        print(info)

        # get device info
        device: Device = await bsblan.device()
        print(device)

        # get sensor from bsblan device
        sensor: Sensor = await bsblan.sensor()
        print(f"outside temperature: {sensor.outside_temperature.value}")


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

## Changelog & Releases

This repository keeps a change log using [GitHub's releases][releases]
functionality. The format of the log is based on
[Keep a Changelog][keepchangelog].

Releases are based on [Semantic Versioning][semver], and use the format
of `MAJOR.MINOR.PATCH`. In a nutshell, the version will be incremented
based on the following:

- `MAJOR`: Incompatible or major changes.
- `MINOR`: Backwards-compatible new features and enhancements.
- `PATCH`: Backwards-compatible bugfixes and package updates.

## Contributing

This is an active open-source project. We are always open to people who want to
use the code or contribute to it.

We've set up a separate document for our
[contribution guidelines](CONTRIBUTING.md).

Thank you for being involved! :heart_eyes:

## Setting up development environment

This Python project is fully managed using the [Poetry][poetry] dependency manager. But also relies on the use of NodeJS for certain checks during development.

You need at least:

- Python 3.10+
- [Poetry][poetry-install]
- NodeJS 16+ (including NPM)

To install all packages, including all development requirements:

```bash
npm install
poetry install
```

As this repository uses the [pre-commit][pre-commit] framework, all changes
are linted and tested with each commit. You can run all checks and tests
manually, using the following command:

```bash
poetry run pre-commit run --all-files
```

To run just the Python tests:

```bash
poetry run pytest
```

## Authors & contributors

The template is from the repository 'elgato' by [Franck Nijhof][frenck].
The setup of this repository is by [Willem-Jan van Rootselaar][liudger].

For a full list of all authors and contributors,
check [the contributor's page][contributors].

## License

MIT License

Copyright (c) 2024 WJ van Rootselaar

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

[bsblanmodule]: https://github.com/fredlcore/bsb_lan
[build-shield]: https://github.com/liudger/python-bsblan/actions/workflows/tests.yaml/badge.svg
[build]: https://github.com/liudger/python-bsblan/actions
[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg
[buymeacoffee]: https://www.buymeacoffee.com/liudger
[codecov-shield]: https://codecov.io/gh/liudger/python-bsblan/branch/Dev/graph/badge.svg?token=ypos87GGxv
[codecov]: https://codecov.io/gh/liudger/python-bsblan
[contributors]: https://github.com/liudger/python-bsblan/graphs/contributors
[frenck]: https://github.com/frenck
[keepchangelog]: http://keepachangelog.com/en/1.0.0/
[license-shield]: https://img.shields.io/github/license/liudger/python-bsblan.svg
[liudger]: https://github.com/liudger
[maintenance-shield]: https://img.shields.io/maintenance/yes/2024.svg
[poetry]: https://python-poetry.org
[poetry-install]: https://python-poetry.org/docs/#installation
[pre-commit]: https://pre-commit.com/
[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg
[pypi]: https://pypi.org/project/python-bsblan/
[python-versions-shield]: https://img.shields.io/pypi/pyversions/python-bsblan
[releases-shield]: https://img.shields.io/github/v/release/liudger/python-bsblan.svg
[releases]: https://github.com/liudger/python-bsblan/releases
[semver]: http://semver.org/spec/v2.0.0.html
[sonarcloud-shield]: https://sonarcloud.io/api/project_badges/measure?project=liudger_python-bsblan&metric=alert_status
[sonarcloud]: https://sonarcloud.io/summary/new_code?id=liudger_python-bsblan

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/liudger/python-bsblan",
    "name": "python-bsblan",
    "maintainer": "Willem-Jan van Rootselaar",
    "docs_url": null,
    "requires_python": ">=3.10,<4.0",
    "maintainer_email": "liudgervr@gmail.com",
    "keywords": "bsblan,thermostat,client,api",
    "author": "Willem-Jan van Rootselaar",
    "author_email": "liudgervr@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/15/ba/898efb6b7e95c4dfb2399e25358a93afa60787c88b10735ac34282a4d0b7/python_bsblan-0.5.18.tar.gz",
    "platform": null,
    "description": "# Python: BSBLan API Client\n\n[![GitHub Release][releases-shield]][releases]\n[![Python Versions][python-versions-shield]][pypi]\n![Project Stage][project-stage-shield]\n![Project Maintenance][maintenance-shield]\n[![License][license-shield]](LICENSE.md)\n\n[![Build Status][build-shield]][build]\n[![Code Coverage][codecov-shield]][codecov]\n[![Quality Gate Status][sonarcloud-shield]][sonarcloud]\n\n[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee]\n\nAsynchronous Python client for BSBLan.\n\n## About\n\nThis package allows you to control and monitor an BSBLan device\nprogrammatically. It is mainly created to allow third-party programs to automate\nthe behavior of [BSBLan][bsblanmodule].\n\n## Installation\n\n```bash\npip install python-bsblan\n```\n\n## Usage\n\n```python\n# pylint: disable=W0621\n\"\"\"Asynchronous Python client for BSBLan.\"\"\"\n\nimport asyncio\n\nfrom bsblan import BSBLan, Info, State\n\n\nasync def main(loop):\n    \"\"\"Show example on controlling your BSBLan device.\n\n    Options:\n    - passkey (http://url/\"passkey\"/) if your device is setup for passkey authentication\n    - username and password if your device is setup for username/password authentication\n\n    \"\"\"\n    async with BSBLan(\n        host=\"10.0.1.60\", passkey=None, username=None, password=None, loop=loop\n    ) as bsblan:\n        # get state from bsblan device\n        state: State = await bsblan.state()\n        print(state)\n\n        # set temp thermostat\n        await bsblan.thermostat(target_temperature=19.0)\n\n        # set hvac_mode (0-3) (protection,auto,reduced,comfort)\n        await bsblan.thermostat(hvac_mode=3)\n\n        # get some generic info from the heater\n        info: Info = await bsblan.info()\n        print(info)\n\n        # get device info\n        device: Device = await bsblan.device()\n        print(device)\n\n        # get sensor from bsblan device\n        sensor: Sensor = await bsblan.sensor()\n        print(f\"outside temperature: {sensor.outside_temperature.value}\")\n\n\nif __name__ == \"__main__\":\n    loop = asyncio.get_event_loop_policy().get_event_loop()\n    loop.run_until_complete(main())\n```\n\n## Changelog & Releases\n\nThis repository keeps a change log using [GitHub's releases][releases]\nfunctionality. The format of the log is based on\n[Keep a Changelog][keepchangelog].\n\nReleases are based on [Semantic Versioning][semver], and use the format\nof `MAJOR.MINOR.PATCH`. In a nutshell, the version will be incremented\nbased on the following:\n\n- `MAJOR`: Incompatible or major changes.\n- `MINOR`: Backwards-compatible new features and enhancements.\n- `PATCH`: Backwards-compatible bugfixes and package updates.\n\n## Contributing\n\nThis is an active open-source project. We are always open to people who want to\nuse the code or contribute to it.\n\nWe've set up a separate document for our\n[contribution guidelines](CONTRIBUTING.md).\n\nThank you for being involved! :heart_eyes:\n\n## Setting up development environment\n\nThis Python project is fully managed using the [Poetry][poetry] dependency manager. But also relies on the use of NodeJS for certain checks during development.\n\nYou need at least:\n\n- Python 3.10+\n- [Poetry][poetry-install]\n- NodeJS 16+ (including NPM)\n\nTo install all packages, including all development requirements:\n\n```bash\nnpm install\npoetry install\n```\n\nAs this repository uses the [pre-commit][pre-commit] framework, all changes\nare linted and tested with each commit. You can run all checks and tests\nmanually, using the following command:\n\n```bash\npoetry run pre-commit run --all-files\n```\n\nTo run just the Python tests:\n\n```bash\npoetry run pytest\n```\n\n## Authors & contributors\n\nThe template is from the repository 'elgato' by [Franck Nijhof][frenck].\nThe setup of this repository is by [Willem-Jan van Rootselaar][liudger].\n\nFor a full list of all authors and contributors,\ncheck [the contributor's page][contributors].\n\n## License\n\nMIT License\n\nCopyright (c) 2024 WJ van Rootselaar\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n[bsblanmodule]: https://github.com/fredlcore/bsb_lan\n[build-shield]: https://github.com/liudger/python-bsblan/actions/workflows/tests.yaml/badge.svg\n[build]: https://github.com/liudger/python-bsblan/actions\n[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg\n[buymeacoffee]: https://www.buymeacoffee.com/liudger\n[codecov-shield]: https://codecov.io/gh/liudger/python-bsblan/branch/Dev/graph/badge.svg?token=ypos87GGxv\n[codecov]: https://codecov.io/gh/liudger/python-bsblan\n[contributors]: https://github.com/liudger/python-bsblan/graphs/contributors\n[frenck]: https://github.com/frenck\n[keepchangelog]: http://keepachangelog.com/en/1.0.0/\n[license-shield]: https://img.shields.io/github/license/liudger/python-bsblan.svg\n[liudger]: https://github.com/liudger\n[maintenance-shield]: https://img.shields.io/maintenance/yes/2024.svg\n[poetry]: https://python-poetry.org\n[poetry-install]: https://python-poetry.org/docs/#installation\n[pre-commit]: https://pre-commit.com/\n[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg\n[pypi]: https://pypi.org/project/python-bsblan/\n[python-versions-shield]: https://img.shields.io/pypi/pyversions/python-bsblan\n[releases-shield]: https://img.shields.io/github/v/release/liudger/python-bsblan.svg\n[releases]: https://github.com/liudger/python-bsblan/releases\n[semver]: http://semver.org/spec/v2.0.0.html\n[sonarcloud-shield]: https://sonarcloud.io/api/project_badges/measure?project=liudger_python-bsblan&metric=alert_status\n[sonarcloud]: https://sonarcloud.io/summary/new_code?id=liudger_python-bsblan\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Asynchronous Python client for BSBLAN",
    "version": "0.5.18",
    "project_urls": {
        "Bug Tracker": "https://github.com/liudger/python-bsblan/issues",
        "Changelog": "https://github.com/liudger/python-bsblan/releases",
        "Documentation": "https://github.com/liudger/python-bsblan",
        "Homepage": "https://github.com/liudger/python-bsblan",
        "Repository": "https://github.com/liudger/python-bsblan"
    },
    "split_keywords": [
        "bsblan",
        "thermostat",
        "client",
        "api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "089cf6b6dd54ee218c5150605e924143c556ee1a009a5b1ece2fff00a80d6eeb",
                "md5": "9f4e740e7c4be48abd00b268a2f1a2e1",
                "sha256": "27a950ecb09eb52407e9eae25fcb77b38dd36bd5a9a6ba2e9cf3bd2ca4f09489"
            },
            "downloads": -1,
            "filename": "python_bsblan-0.5.18-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9f4e740e7c4be48abd00b268a2f1a2e1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<4.0",
            "size": 9877,
            "upload_time": "2024-01-16T08:30:19",
            "upload_time_iso_8601": "2024-01-16T08:30:19.186917Z",
            "url": "https://files.pythonhosted.org/packages/08/9c/f6b6dd54ee218c5150605e924143c556ee1a009a5b1ece2fff00a80d6eeb/python_bsblan-0.5.18-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "15ba898efb6b7e95c4dfb2399e25358a93afa60787c88b10735ac34282a4d0b7",
                "md5": "593aafa548fc167f8263e0abe3b64f76",
                "sha256": "75b3299db5e1a8764dc0f73c6617d242c20d2193b64d217e683a1fa5d77d74cf"
            },
            "downloads": -1,
            "filename": "python_bsblan-0.5.18.tar.gz",
            "has_sig": false,
            "md5_digest": "593aafa548fc167f8263e0abe3b64f76",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<4.0",
            "size": 12266,
            "upload_time": "2024-01-16T08:30:20",
            "upload_time_iso_8601": "2024-01-16T08:30:20.828832Z",
            "url": "https://files.pythonhosted.org/packages/15/ba/898efb6b7e95c4dfb2399e25358a93afa60787c88b10735ac34282a4d0b7/python_bsblan-0.5.18.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-16 08:30:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "liudger",
    "github_project": "python-bsblan",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "python-bsblan"
}
        
Elapsed time: 0.16900s