Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/send data #45

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ updates:
timezone: Europe/Berlin
open-pull-requests-limit: 5
assignees:
- sg-app
- pdanysz
versioning-strategy: increase

- package-ecosystem: github-actions
Expand All @@ -19,4 +19,4 @@ updates:
timezone: Europe/Berlin
open-pull-requests-limit: 5
assignees:
- sg-app
- pdanysz
15 changes: 14 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
{
"common": {
"name": "kebahp",
"version": "0.1.1",
"version": "0.1.3",
"news": {
"0.1.3": {
"pl": "dodano obsługę wysyłki danych do KeBaHeatPump",
"en": "added sending data to KeBaHeatPump",
"de": "Daten werden gesendet",
"ru": "данные отправляются",
"pt": "dados enviados",
"nl": "gegevens worden verzonden",
"fr": "données envoyées",
"it": "dati inviati",
"es": "datos enviados",
"uk": "дані відправляються",
"zh-cn": "数据发送"
},
"0.1.1": {
"en": "fix version error",
"de": "fehler bei der ausführung",
Expand Down
10 changes: 10 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Kebahp extends utils.Adapter {

this.on("ready", this.onReady.bind(this));
this.on("unload", this.onUnload.bind(this));
this.on("stateChange", this.onStateChange.bind(this));
}

/**
Expand Down Expand Up @@ -190,12 +191,21 @@ class Kebahp extends utils.Adapter {
* @param {ioBroker.State | null | undefined} state
*/
onStateChange(id, state) {
this.log.debug(`state ${id} changed: ${state?.val} (ack = ${state?.ack})`);

if (!this.apiClient) {
this.log.error("Apiclient not instanced.");
return;
}

if (state) {
// The state was changed
this.log.info(`state ${id} changed: ${state.val} (ack = ${state.ack})`);
this.setState(id, state.val);
} else {
// The state was deleted
this.log.info(`state ${id} deleted`);
this.setState(id, null);
}
}

Expand Down
Loading