nuheat


Namenuheat JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/broox/python-nuheat
SummaryA Python library that allows control of connected NuHeat Signature radiant floor thermostats.
upload_time2023-01-19 02:29:47
maintainer
docs_urlNone
authorDerek Brooks
requires_python>=3.7
licenseMIT
keywords nuheat thermostat home automation python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Python NuHeat

[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/nuheat?style=flat-square)](https://pypi.org/project/nuheat/)
[![PyPI - Version](https://img.shields.io/pypi/v/nuheat?style=flat-square)](https://pypi.org/project/nuheat/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/nuheat?style=flat-square)](https://pypi.org/project/nuheat/)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/broox/python-nuheat/Python%20package?style=flat-square)](https://github.com/broox/python-nuheat/actions?query=branch%3Amaster)
[![Coveralls](https://img.shields.io/coveralls/github/broox/python-nuheat?style=flat-square)](https://coveralls.io/github/broox/python-nuheat?branch=master)
[![Snyk Vulnerabilities for GitHub Repo](https://img.shields.io/snyk/vulnerabilities/github/broox/python-nuheat?style=flat-square)](https://snyk.io/advisor/python/nuheat)

A Python 3 library that allows control of connected [NuHeat Signature](http://www.nuheat.com/products/thermostats/signature-thermostat) radiant floor thermostats.

* This uses the web-based NuHeat API, so it requires an external internet connection
* The API in use is not an officially published API, so it could change without notice
* Please contribute!

# Installation

```shell
$ pip install nuheat
```

# Usage

```python
from nuheat import NuHeat

# Initalize an API session with your login credentials
api = NuHeat("email@example.com", "your-secure-password")
api.authenticate()

# Fetch a thermostat by serial number / ID. This can be found on the NuHeat website by selecting
# your thermostat and noting the Thermostat ID
thermostat = api.get_thermostat("12345")

# Get the current temperature of the thermostat
thermostat.fahrenheit
thermostat.celsius

# Get the current target temperature of the thermostat
thermostat.target_fahrenheit
thermostat.target_celsius

# Get the minimum and maximum temperatures supported by the thermostat
thermostat.min_fahrenheit
thermostat.max_fahrenheit
thermostat.min_celsius
thermostat.max_celsius

# Get the current mode of the thermostat
thermostat.schedule_mode

# The possible schedule modes are one of the following 3 integers:
# 1. Run the schedule programmed into the thermostat
# 2. Temporarily hold a target temperature until the next scheduled event
# 3. Permanently hold a target temperature until the mode is manually changed

# Get other properties
thermostat.heating
thermostat.online
thermostat.serial_number

# Set a new temperature and permanently hold
# Note: Any pre-programmed thermostat schedules will be ignored until you resume the schedule or
# change the mode.
thermostat.set_target_fahrenheit(72)

# If you prefer celsius...
thermostat.set_target_celsius(22)

# You can also do this via the convenience property setters
thermostat.target_fahrenheit = 72

# or with celsius
thermostat.target_celsius = 22

# To resume the schedule programmed into the thermostat
thermostat.resume_schedule()

# Which is effectively the same as explicitly changing the mode like so
thermostat.schedule_mode = 1

# To set a new target temperature with an explicit schedule mode
thermostat.set_target_fahrenheit(72, mode=2)

# If you prefer celsius, you can use that too
thermostat.set_target_celsius(22, mode=2)

# Set a target temperature until a specified datetime
# Note: A timezone aware datetime should be passed in, otherwise UTC will be assumed
from datetime import datetime, timedelta, timezone
hold_time = datetime.now() + timedelta(hours=4)
thermostat.set_target_fahrenheit(69, mode=2, hold_time=hold_time)
```

# Contributing

Pull requests are always welcome!

## Running locally with Docker

```shell
# Build and run the docker container:
$ docker build -t python-nuheat .
$ docker run -it --rm -v $(pwd):/python-nuheat python-nuheat

# To run the interactive shell:
$ ipython

# To run tests:
$ pytest
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/broox/python-nuheat",
    "name": "nuheat",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "nuheat,thermostat,home automation,python",
    "author": "Derek Brooks",
    "author_email": "derek@broox.com",
    "download_url": "https://files.pythonhosted.org/packages/96/1f/89b24cfec1b477f831f9eb9f1d7acd7364c6137dbffcb9d2b617aa83496c/nuheat-1.0.1.tar.gz",
    "platform": null,
    "description": "# Python NuHeat\n\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/nuheat?style=flat-square)](https://pypi.org/project/nuheat/)\n[![PyPI - Version](https://img.shields.io/pypi/v/nuheat?style=flat-square)](https://pypi.org/project/nuheat/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/nuheat?style=flat-square)](https://pypi.org/project/nuheat/)\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/broox/python-nuheat/Python%20package?style=flat-square)](https://github.com/broox/python-nuheat/actions?query=branch%3Amaster)\n[![Coveralls](https://img.shields.io/coveralls/github/broox/python-nuheat?style=flat-square)](https://coveralls.io/github/broox/python-nuheat?branch=master)\n[![Snyk Vulnerabilities for GitHub Repo](https://img.shields.io/snyk/vulnerabilities/github/broox/python-nuheat?style=flat-square)](https://snyk.io/advisor/python/nuheat)\n\nA Python 3 library that allows control of connected [NuHeat Signature](http://www.nuheat.com/products/thermostats/signature-thermostat) radiant floor thermostats.\n\n* This uses the web-based NuHeat API, so it requires an external internet connection\n* The API in use is not an officially published API, so it could change without notice\n* Please contribute!\n\n# Installation\n\n```shell\n$ pip install nuheat\n```\n\n# Usage\n\n```python\nfrom nuheat import NuHeat\n\n# Initalize an API session with your login credentials\napi = NuHeat(\"email@example.com\", \"your-secure-password\")\napi.authenticate()\n\n# Fetch a thermostat by serial number / ID. This can be found on the NuHeat website by selecting\n# your thermostat and noting the Thermostat ID\nthermostat = api.get_thermostat(\"12345\")\n\n# Get the current temperature of the thermostat\nthermostat.fahrenheit\nthermostat.celsius\n\n# Get the current target temperature of the thermostat\nthermostat.target_fahrenheit\nthermostat.target_celsius\n\n# Get the minimum and maximum temperatures supported by the thermostat\nthermostat.min_fahrenheit\nthermostat.max_fahrenheit\nthermostat.min_celsius\nthermostat.max_celsius\n\n# Get the current mode of the thermostat\nthermostat.schedule_mode\n\n# The possible schedule modes are one of the following 3 integers:\n# 1. Run the schedule programmed into the thermostat\n# 2. Temporarily hold a target temperature until the next scheduled event\n# 3. Permanently hold a target temperature until the mode is manually changed\n\n# Get other properties\nthermostat.heating\nthermostat.online\nthermostat.serial_number\n\n# Set a new temperature and permanently hold\n# Note: Any pre-programmed thermostat schedules will be ignored until you resume the schedule or\n# change the mode.\nthermostat.set_target_fahrenheit(72)\n\n# If you prefer celsius...\nthermostat.set_target_celsius(22)\n\n# You can also do this via the convenience property setters\nthermostat.target_fahrenheit = 72\n\n# or with celsius\nthermostat.target_celsius = 22\n\n# To resume the schedule programmed into the thermostat\nthermostat.resume_schedule()\n\n# Which is effectively the same as explicitly changing the mode like so\nthermostat.schedule_mode = 1\n\n# To set a new target temperature with an explicit schedule mode\nthermostat.set_target_fahrenheit(72, mode=2)\n\n# If you prefer celsius, you can use that too\nthermostat.set_target_celsius(22, mode=2)\n\n# Set a target temperature until a specified datetime\n# Note: A timezone aware datetime should be passed in, otherwise UTC will be assumed\nfrom datetime import datetime, timedelta, timezone\nhold_time = datetime.now() + timedelta(hours=4)\nthermostat.set_target_fahrenheit(69, mode=2, hold_time=hold_time)\n```\n\n# Contributing\n\nPull requests are always welcome!\n\n## Running locally with Docker\n\n```shell\n# Build and run the docker container:\n$ docker build -t python-nuheat .\n$ docker run -it --rm -v $(pwd):/python-nuheat python-nuheat\n\n# To run the interactive shell:\n$ ipython\n\n# To run tests:\n$ pytest\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python library that allows control of connected NuHeat Signature radiant floor thermostats.",
    "version": "1.0.1",
    "split_keywords": [
        "nuheat",
        "thermostat",
        "home automation",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b851d7b567b9d9b6682154e37a1592b41c1af5862134c7e891e6855eee0c7363",
                "md5": "b8e1a1d4175684019ab8bb4be5c840ea",
                "sha256": "6e984eddae3a24ba885f8740758debe4b7c091ea6753d53200cd971e9cf80a4e"
            },
            "downloads": -1,
            "filename": "nuheat-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b8e1a1d4175684019ab8bb4be5c840ea",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 8941,
            "upload_time": "2023-01-19T02:29:45",
            "upload_time_iso_8601": "2023-01-19T02:29:45.444988Z",
            "url": "https://files.pythonhosted.org/packages/b8/51/d7b567b9d9b6682154e37a1592b41c1af5862134c7e891e6855eee0c7363/nuheat-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "961f89b24cfec1b477f831f9eb9f1d7acd7364c6137dbffcb9d2b617aa83496c",
                "md5": "ba6237e9532feb399c9d7d99a3f67726",
                "sha256": "e2733aa2312d834090d26b41764da6b59fad2c1e83486fa0965910713977b3b4"
            },
            "downloads": -1,
            "filename": "nuheat-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "ba6237e9532feb399c9d7d99a3f67726",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 9498,
            "upload_time": "2023-01-19T02:29:47",
            "upload_time_iso_8601": "2023-01-19T02:29:47.340038Z",
            "url": "https://files.pythonhosted.org/packages/96/1f/89b24cfec1b477f831f9eb9f1d7acd7364c6137dbffcb9d2b617aa83496c/nuheat-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-19 02:29:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "broox",
    "github_project": "python-nuheat",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "nuheat"
}
        
Elapsed time: 0.35716s