Skip to content

Commit

Permalink
Merge pull request #19 from jbouwh/update-project-details-readme
Browse files Browse the repository at this point in the history
Update project details and readme
  • Loading branch information
jbouwh authored Jun 7, 2024
2 parents c68c2f0 + 421a01d commit 1001edb
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# .pre-commit-config.yaml file for https://github.com/zxdavb
# .pre-commit-config.yaml file for https://github.com/jbouwh/incomfort-client

repos:
- repo: https://github.com/psf/black
Expand All @@ -11,7 +11,7 @@ repos:
files: ^(incomfort.*/.+)?[^/]+\.py$

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -21,7 +21,7 @@ repos:
exclude: ^incomfort.*/tests\.py$

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]
39 changes: 27 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,42 @@
[![CircleCI](https://circleci.com/gh/zxdavb/incomfort-client.svg?style=svg)](https://circleci.com/gh/zxdavb/incomfort-client)
[![PyPI version](https://badge.fury.io/py/incomfort-client.svg)](https://badge.fury.io/py/incomfort-client)

# incomfort-client

Python client library for **Intergas boilers** accesible via a **Lan2RF gateway** by abstracting its HTTP API. It includes a basic CLI to demonstrate how to use the library.

This library was previously called **intouch-client**, as it is known in the UK as **InTouch**, but in mainland Europe (especially the Netherlands, where is it popular) it is known as **Incomfort**.

It is written for Python v3.6.7. It is available as a [PyPi package](https://pypi.org/project/incomfort-client/).
It is written for Python v3.9+. It is available as a [PyPi package](https://pypi.org/project/incomfort-client/).

With many thanks, the code was refactored by @zxdavb and maintained for about 5 years, and maintanance now has been taken over by @jbouwh to be able to cuntinue support.

The library is used as backend code for the [Intergas InComfort/Intouch Lan2RF gateway](https://www.home-assistant.io/integrations/incomfort/) integration with [Home Assistant](https://www.home-assistant.io/).

### Porting from syncio libraries

This library is based upon https://github.com/bwesterb/incomfort, but uses **aiohttp** rather than synchronous I/O (such as **requests** or **httplib**).

Where possible, it uses uses the same methods and properties as **bwesterb/incomfort**, but with the following differences:

- **`Gateway`** class
- added kwargs: `username`, `password` (used for newer versions of firmware)
- **`Gateway`** class

- **`Heater`** class
- renamed: `is_burning`, `is_failed`, `is_pumping`, `is_tapping`
- moved: `room_temp`, `setpoint`, `setpoint_override`, `set` to **`Room`** class
- new/added: `update`, `status`, `rooms`
- added kwargs: `username`, `password` (used for newer versions of firmware)

- **`Room`** class has been added, and some methods moved in from **`Heater`**
- same name: `room_temp`, `setpoint`
- renamed: `override`, `set_override`
- new/added: `status`
- **`Heater`** class

- renamed: `is_burning`, `is_failed`, `is_pumping`, `is_tapping`
- moved: `room_temp`, `setpoint`, `setpoint_override`, `set` to **`Room`** class
- new/added: `update`, `status`, `rooms`

- **`Room`** class has been added, and some methods moved in from **`Heater`**
- same name: `room_temp`, `setpoint`
- renamed: `override`, `set_override`
- new/added: `status`

### Basic CLI included

There is a very basic CLI (this output has been formatted for readability):

```bash
(venv) root@hostname:~/$ python inclient.py ${HOSTNAME}
{
Expand Down Expand Up @@ -55,7 +64,9 @@ There is a very basic CLI (this output has been formatted for readability):
```

### QA/CI via CircleCI

QA includes comparing JSON from **cURL** with output from this app using **diff** (note the `--raw` switch):

```bash
(venv) root@hostname:~/$ curl -X GET http://${HOSTNAME}/data.json?heater=0 | \
python -c "import sys, json; print(json.load(sys.stdin))" > a.out
Expand All @@ -64,9 +75,13 @@ QA includes comparing JSON from **cURL** with output from this app using **diff*

(venv) root@hostname:~/$ diff a.out b.out
```

Newer versions of the gateway require authentication:

```bash
(venv) root@hostname:~/$ python inclient.py ${HOSTNAME} -u ${USER} -p ${PASS}

(venv) root@hostname:~/$ curl --user ${USER}:${PASS} -X GET http://${HOSTNAME}/protect/data.json?heater=0
```

> Note that at the moment CircleCI is not active.
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
VERSION = eval(line.split("=")[-1])
break

URL = "https://github.com/zxdavb/incomfort-client"
URL = "https://github.com/jbouwh/incomfort-client"

with open("README.md", "r") as fh:
LONG_DESCRIPTION = fh.read()
Expand All @@ -35,8 +35,8 @@ def run(self):
name="incomfort-client",
description="An aiohttp-based client for Intergas InComfort/InTouch Lan2RF systems",
keywords=["intergas", "incomfort", "intouch", "lan2rf"],
author="David Bonnes",
author_email="[email protected]",
author="Jan Bouwhuis",
author_email="[email protected]",
url=URL,
download_url=f"{URL}/archive/{VERSION}.tar.gz",
install_requires=[list(val.strip() for val in open("requirements.txt"))],
Expand All @@ -50,7 +50,7 @@ def run(self):
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Home Automation",
],
cmdclass={
Expand Down

0 comments on commit 1001edb

Please sign in to comment.