Skip to content

Commit

Permalink
v6.0.18
Browse files Browse the repository at this point in the history
  • Loading branch information
seydx committed Oct 5, 2021
1 parent 14f4a64 commit d736dcc
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 13 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

# v6.0.18 - 2021-10-06

## Bugfixes
- Minor Bugfixes

# v6.0.17 - 2021-10-06

## Other Changes
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ This plugin allows almost full control of **AVM** hardware like:
- FakeGato support
- **Presence**
- Detect occupancy through wifi,
- Detect occupancy through guest wifi,
- Fakegato support
- **Watch Network**
- Control devices if connected or disconnected from network
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-fritz-platform",
"version": "6.0.17",
"version": "6.0.18",
"description": "Homebridge Plugin to control FritzBox router, smarthome devices and more.",
"main": "index.js",
"funding": [
Expand Down
32 changes: 21 additions & 11 deletions src/accessories/smarthome/smarthome.handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -1587,18 +1587,28 @@ class Handler {
* leads to problems.
*/

accessory.context.hkrTimeout = setTimeout(async () => {
logger.info(`Temperature ${state}`, `${accessory.displayName} (${subtype})`);
let temp = Math.round((Math.min(Math.max(state, 8), 28) - 8) * 2) + 16;

cmd = {
...cmd,
switchcmd: 'sethkrtsoll',
param: temp,
};
if (accessory.context.hkrTimeout) {
clearTimeout(accessory.context.hkrTimeout);
accessory.context.hkrTimeout = null;
}

logger.debug(`Send CMD: ${JSON.stringify(cmd)}`, `${accessory.displayName} (${subtype})`);
await requestAHA(this.fritzbox.url.hostname, cmd);
accessory.context.hkrTimeout = setTimeout(async () => {
try {
logger.info(`Temperature ${state}`, `${accessory.displayName} (${subtype})`);
let temp = Math.round((Math.min(Math.max(state, 8), 28) - 8) * 2) + 16;

cmd = {
...cmd,
switchcmd: 'sethkrtsoll',
param: temp,
};

logger.debug(`Send CMD: ${JSON.stringify(cmd)}`, `${accessory.displayName} (${subtype})`);
await requestAHA(this.fritzbox.url.hostname, cmd);
} catch (err) {
logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`);
logger.error(err, `${accessory.displayName} (${subtype})`);
}
}, 100);
} else {
logger.info(`${state ? 'ON' : 'OFF'}`, `${accessory.displayName} (${subtype})`);
Expand Down

0 comments on commit d736dcc

Please sign in to comment.