Skip to content

Commit

Permalink
feat: read tags dynamically based on enabled services
Browse files Browse the repository at this point in the history
  • Loading branch information
theknut committed Feb 15, 2024
1 parent 407f25f commit c172b8d
Show file tree
Hide file tree
Showing 31 changed files with 2,083 additions and 683 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run test:jest
- run: npm run test:jest -- --silent

coverage:
if: contains(github.event.head_commit.message, '[skip ci]') == false
Expand Down
105 changes: 13 additions & 92 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Logo](admin/waterkotte-easycon.png)
![Logo](docs/banner.jpg)

# ioBroker.waterkotte-easycon

Expand All @@ -13,102 +13,21 @@

## waterkotte-easycon adapter for ioBroker

Read and write parameters of Waterkotte EasyCon heat pumps via CGI requests
Read and write parameters of Waterkotte EasyCon heat pumps via CGI requests. Tested with Waterkotte EcoTouch Ai1 Geo (2017 model).

## Developer manual
## Features

This section is intended for the developer. It can be deleted later.
### Implemented

### DISCLAIMER
- automatic reading of values from heat pump dependending on the used functions (water, heating, cooling, photovoltaics, solar, ...)

Please make sure that you consider copyrights and trademarks when you use names or logos of a company and add a disclaimer to your README.
You can check other adapters for examples or ask in the developer community. Using a name or logo of a company without permission may cause legal problems for you.
### Planned

### Getting started

You are almost done, only a few steps left:

1. Create a new repository on GitHub with the name `ioBroker.waterkotte-easycon`

1. Push all files to the GitHub repo. The creator has already set up the local repository for you:
```bash
git push origin main
```
1. Add a new secret under https://github.com/theknut/ioBroker.waterkotte-easycon/settings/secrets. It must be named `AUTO_MERGE_TOKEN` and contain a personal access token with push access to the repository, e.g. yours. You can create a new token under https://github.com/settings/tokens.

1. Head over to [src/main.ts](src/main.ts) and start programming!

### Best Practices

We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should
check them out. If you're already experienced, you should also take a look at them - you might learn something new :)

### Scripts in `package.json`

Several npm scripts are predefined for your convenience. You can run them using `npm run <scriptname>`
| Script name | Description |
|-------------|-------------|
| `build` | Compile the TypeScript sources. |
| `watch` | Compile the TypeScript sources and watch for changes. |
| `test:ts` | Executes the tests you defined in `*.test.ts` files. |
| `test:package` | Ensures your `package.json` and `io-package.json` are valid. |
| `test:integration` | Tests the adapter startup with an actual instance of ioBroker. |
| `test` | Performs a minimal test run on package files and your tests. |
| `check` | Performs a type-check on your code (without compiling anything). |
| `coverage` | Generates code coverage using your test files. |
| `lint` | Runs `ESLint` to check your code for formatting errors and potential bugs. |
| `translate` | Translates texts in your adapter to all required languages, see [`@iobroker/adapter-dev`](https://github.com/ioBroker/adapter-dev#manage-translations) for more details. |
| `release` | Creates a new release, see [`@alcalzone/release-script`](https://github.com/AlCalzone/release-script#usage) for more details. |

### Configuring the compilation

The adapter template uses [esbuild](https://esbuild.github.io/) to compile TypeScript and/or React code. You can configure many compilation settings
either in `tsconfig.json` or by changing options for the build tasks. These options are described in detail in the
[`@iobroker/adapter-dev` documentation](https://github.com/ioBroker/adapter-dev#compile-adapter-files).

### Writing tests

When done right, testing code is invaluable, because it gives you the
confidence to change your code while knowing exactly if and when
something breaks. A good read on the topic of test-driven development
is https://hackernoon.com/introduction-to-test-driven-development-tdd-61a13bc92d92.
Although writing tests before the code might seem strange at first, but it has very
clear upsides.

The template provides you with basic tests for the adapter startup and package files.
It is recommended that you add your own tests into the mix.

### Publishing the adapter

Using GitHub Actions, you can enable automatic releases on npm whenever you push a new git tag that matches the form
`v<major>.<minor>.<patch>`. We **strongly recommend** that you do. The necessary steps are described in `.github/workflows/test-and-release.yml`.

Since you installed the release script, you can create a new
release simply by calling:

```bash
npm run release
```

Additional command line options for the release script are explained in the
[release-script documentation](https://github.com/AlCalzone/release-script#command-line).

To get your adapter released in ioBroker, please refer to the documentation
of [ioBroker.repositories](https://github.com/ioBroker/ioBroker.repositories#requirements-for-adapter-to-get-added-to-the-latest-repository).

### Test the adapter manually with dev-server

Since you set up `dev-server`, you can use it to run, test and debug your adapter.

You may start `dev-server` by calling from your dev directory:

```bash
dev-server watch
```

The ioBroker.admin interface will then be available at http://localhost:8081/

Please refer to the [`dev-server` documentation](https://github.com/ioBroker/dev-server#command-line) for more details.
- notify on heat pump alarms
- synchronize time and date
- write values
- read and manage schedules
- SG-ready like control of target values

## Changelog

Expand All @@ -119,6 +38,8 @@ Please refer to the [`dev-server` documentation](https://github.com/ioBroker/dev

### **WORK IN PROGRESS**

### V0.0.1 (2024-02-20)

- (theknut) initial release

## License
Expand Down
158 changes: 149 additions & 9 deletions admin/jsonConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,165 @@
"items": {
"ipAddress": {
"type": "text",
"label": "IP",
"newLine": true
"label": {
"en": "Ip address",
"de": "IP-Adresse",
"ru": "Ip адрес",
"pt": "Endereço Ip",
"nl": "Ip adres",
"fr": "Adresse IP",
"it": "Indirizzo Ip",
"es": "Dirección de identificación",
"pl": "Adres IP",
"uk": "Ip адреса",
"zh-cn": "叶子地址"
},
"sm": 3
},
"username": {
"type": "text",
"label": "Username",
"default": "waterkotte",
"newLine": true
"label": {
"en": "Username",
"de": "Benutzername",
"ru": "Имя пользователя",
"pt": "Nome de utilizador",
"nl": "Gebruikersnaam",
"fr": "Nom d'utilisateur",
"it": "Nome utente",
"es": "Nombre de usuario",
"pl": "Nazwa użytkownika",
"uk": "Ім'я користувача",
"zh-cn": "用户名"
},
"help": {
"en": "Use 'waterkotte' if unknown",
"de": "Verwenden Sie 'waterkotte', wenn unbekannt",
"ru": "Используйте 'waterkotte', если неизвестно",
"pt": "Use 'waterkotte' se desconhecido",
"nl": "Gebruik 'waterkotte' indien onbekend",
"fr": "Utiliser 'waterkotte' si inconnu",
"it": "Utilizzare 'waterkotte' se sconosciuto",
"es": "Use 'waterkotte' si se desconoce",
"pl": "Użyj 'waterkotte', jeśli jest nieznany",
"uk": "Використовуйте 'waterkotte' якщо невідомо",
"zh-cn": "如果未知, 请使用“ waterkotte ”"
},
"sm": 3
},
"password": {
"type": "password",
"default": "waterkotte",
"label": "Password"
"help": {
"en": "Use 'waterkotte' if unknown",
"de": "Verwenden Sie 'waterkotte', wenn unbekannt",
"ru": "Используйте 'waterkotte', если неизвестно",
"pt": "Use 'waterkotte' se desconhecido",
"nl": "Gebruik 'waterkotte' indien onbekend",
"fr": "Utiliser 'waterkotte' si inconnu",
"it": "Utilizzare 'waterkotte' se sconosciuto",
"es": "Use 'waterkotte' si se desconoce",
"pl": "Użyj 'waterkotte', jeśli jest nieznany",
"uk": "Використовуйте 'waterkotte' якщо невідомо",
"zh-cn": "如果未知, 请使用“ waterkotte ”"
},
"label": {
"en": "Password",
"de": "Passwort",
"ru": "Пароль",
"pt": "Senha",
"nl": "Wachtwoord",
"fr": "Mot de passe",
"it": "Password",
"es": "Contraseña",
"pl": "Hasło",
"uk": "Логін",
"zh-cn": "密码"
},
"sm": 3
},
"pollingInterval": {
"type": "number",
"default": 300000,
"label": "Polling interval",
"help": "In milliseconds (default = 300000 ms = 5 m)"
"label": {
"en": "Update interval",
"de": "Update-Intervall",
"ru": "Интервал обновления",
"pt": "Intervalo de atualização",
"nl": "Bijwerken interval",
"fr": "Intervalle de mise à jour",
"it": "Intervallo di aggiornamento",
"es": "Intervalo de actualización",
"pl": "Przedział aktualizacji",
"uk": "Період оновлення",
"zh-cn": "更新间隔"
},
"help": {
"en": "In milliseconds (default = 300000 ms = 5 m)",
"de": "In Millisekunden (Standard = 300000 ms = 5 m)",
"ru": "В миллисекундах (по умолчанию = 30000 мс = 5 м)",
"pt": "Em milissegundos (padrão = 300000 ms = 5 m)",
"nl": "In milliseconden (standaard = 300000 ms = 5 m)",
"fr": "En millisecondes (par défaut = 300 000 ms = 5 m)",
"it": "In millisecondi (default = 300000 ms = 5 m)",
"es": "En milisegundos (por defecto = 300000 ms = 5 m)",
"pl": "W milisekundach (domyślnie = 300000 ms = 5 m)",
"uk": "У мілісекундах (default = 300000 мс = 5 м)",
"zh-cn": "毫秒( 默认 = 300 000 ms = 5 m)"
},
"sm": 3
},
"pathFlavor": {
"type": "select",
"options": [
{ "label": "Path + Tag Id (e.g. 'Heating.A32')", "value": 0 },
{ "label": "Path + Description (e.g. 'Heating.Target_value')", "value": 1 }
],
"default": 1,
"label": {
"en": "Id format",
"de": "Id Format",
"ru": "Формат Id",
"pt": "Formato de identificação",
"nl": "Id-formaat",
"fr": "Format Id",
"it": "Formato Id",
"es": "Formato Id",
"pl": "Format Id",
"uk": "Формат Id",
"zh-cn": "Id 格式"
},
"help": {
"en": "Select how the id should be formatted",
"de": "Wählen Sie aus, wie die Id formatiert werden soll",
"ru": "Выберите, как следует отформатировать id",
"pt": "Selecione como o id deve ser formatado",
"nl": "Selecteer hoe de id geformatteerd moet worden",
"fr": "Sélectionnez comment l'identifiant doit être formaté",
"it": "Selezionare come l'id dovrebbe essere formattato",
"es": "Seleccione cómo debe formatear el id",
"pl": "Wybierz sposób formatowania identyfikatora",
"uk": "Виберіть, як id слід відформатувати",
"zh-cn": "选择编号的格式"
},
"sm": 6,
"newLine": true
},
"removeWhitespace": {
"type": "checkbox",
"default": true,
"label": {
"en": "Remove space from id",
"de": "Leerzeichen in der Id entfernen",
"ru": "Удалить пространство от id",
"pt": "Remover espaço de id",
"nl": "Spatie verwijderen uit id",
"fr": "Supprimer l'espace de l'id",
"it": "Rimuovere lo spazio da id",
"es": "Quitar espacio de id",
"pl": "Usuń miejsce z id",
"uk": "Видалити місце з id",
"zh-cn": "从 id 中删除空格"
},
"sm": 6
}
}
}
52 changes: 36 additions & 16 deletions build/dictionary.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build/dictionary.js.map

Large diffs are not rendered by default.

0 comments on commit c172b8d

Please sign in to comment.