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

2.5.11 #565

Merged
merged 9 commits into from
Aug 10, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [18, 20]
node-version: [18, 20, 22]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 - 2024 foxthefox@wysiwis.net
Copyright (c) 2024 foxthefox <foxthefox@wysiwis.net>
Copyright (c) 2018 - 2024 foxthefox <foxthefox@wysiwis.net>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,16 @@ otherwise it is more complex and individually to be parametrized.
* DECT 350 (batterylow, battery)

## Changelog
### 2.5.10 (npm)

### 2.5.11 (npm)
* upadate devDeps, linting error corrections
* iob checker corrections

### 2.5.10
* more loggimg for issue #500 of restart loop
* some error messages downgraded to warnings
* correction related to thermostat value take over, when reduced setting is activated
* update devDeps

### 2.5.9 (npm)
* correction for statistics,
Expand Down Expand Up @@ -549,3 +555,5 @@ otherwise it is more complex and individually to be parametrized.
The MIT License (MIT)

Copyright (c) 2018 - 2024 foxthefox <foxthefox@wysiwis.net>

Copyright (c) 2024 foxthefox <foxthefox@wysiwis.net>
22 changes: 22 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import globals from 'globals';
import pluginJs from '@eslint/js';

//["**/*.js"],

export default [
{ files: [ 'main.js' ], languageOptions: { sourceType: 'commonjs' } },
{
ignores: [
'.dev-server/**/*',
'admin/build/**/*',
'admin/words.js',
'test/**/*',
'main.test.js',
'lib/**/*',
'docs/**/*',
'widgets/**/*'
]
},
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended
];
481 changes: 162 additions & 319 deletions io-package.json

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class Fritzdect extends utils.Adapter {

// jsonUI should transfer PW decrypted
if (settings.Username !== '' && settings.Password !== '') {
this.getForeignObject('system.config', async (err, obj) => {
this.getForeignObject('system.config', async (err) => {
// Adapter is alive, make API call
// Make a call to fritzboxAPI and get a list devices/groups and templates

Expand Down Expand Up @@ -304,6 +304,7 @@ class Fritzdect extends utils.Adapter {
this.log.info('cleaned everything up...');
callback();
} catch (e) {
this.log.error(e);
callback();
}
}
Expand Down Expand Up @@ -373,7 +374,7 @@ class Fritzdect extends utils.Adapter {
await this.setStateAsync('DECT_' + id + '.hkrmode', { val: 1, ack: false }); //damit das Ventil auch regelt
await this.fritz
.setTempTarget(id, 'off')
.then((sid) => {
.then(() => {
this.log.debug('Switched Mode' + id + ' to closed');
})
.catch((e) => this.errorHandlerApi(e));
Expand Down Expand Up @@ -442,7 +443,7 @@ class Fritzdect extends utils.Adapter {
} else if (state.val === 1) {
await this.fritz
.setTempTarget(id, 'off')
.then((sid) => {
.then(() => {
this.log.debug('Switched Mode' + id + ' to closed.');
this.setStateAsync('DECT_' + id + '.operationmode', {
val: 'Off',
Expand All @@ -453,7 +454,7 @@ class Fritzdect extends utils.Adapter {
} else if (state.val === 2) {
await this.fritz
.setTempTarget(id, 'on')
.then((sid) => {
.then(() => {
this.log.debug('Switched Mode' + id + ' to opened permanently');
this.setStateAsync('DECT_' + id + '.operationmode', {
val: 'On',
Expand Down Expand Up @@ -517,7 +518,7 @@ class Fritzdect extends utils.Adapter {
});
await this.fritz
.setTempTarget(id, 'off')
.then((sid) => {
.then(() => {
this.log.debug('Switched Mode' + id + ' to closed.');
this.setStateAsync('DECT_' + id + '.operationmode', {
val: 'Off',
Expand All @@ -538,7 +539,7 @@ class Fritzdect extends utils.Adapter {
});
await this.fritz
.setTempTarget(id, 'on')
.then((sid) => {
.then(() => {
this.log.debug('Switched Mode' + id + ' to opened permanently');
this.setStateAsync('DECT_' + id + '.operationmode', {
val: 'On',
Expand Down Expand Up @@ -656,7 +657,7 @@ class Fritzdect extends utils.Adapter {
) {
this.fritz
.setWindowOpen(id, 0)
.then((sid) => {
.then(() => {
this.log.debug('Reset thermostat windowopen ' + id + ' to ' + state.val);
this.setStateAsync('DECT_' + id + '.windowopenactiv', {
val: state.val,
Expand Down Expand Up @@ -746,7 +747,7 @@ class Fritzdect extends utils.Adapter {
if (switchtyp.val === 'switch') {
this.fritz
.setSwitchOff(id)
.then((sid) => {
.then(() => {
this.log.debug('Turned switch ' + id + ' off');
this.setStateAsync('DECT_' + id + '.state', {
val: false,
Expand All @@ -757,7 +758,7 @@ class Fritzdect extends utils.Adapter {
} else {
this.fritz
.setSimpleOff(id)
.then((sid) => {
.then(() => {
this.log.debug('Turned switch ' + id + ' off');
this.setStateAsync('DECT_' + id + '.state', {
val: false,
Expand Down Expand Up @@ -786,7 +787,7 @@ class Fritzdect extends utils.Adapter {
if (switchtyp.val === 'switch') {
this.fritz
.setSwitchOn(id)
.then((sid) => {
.then(() => {
this.log.debug('Turned switch ' + id + ' on');
this.setStateAsync('DECT_' + id + '.state', {
val: true,
Expand All @@ -797,7 +798,7 @@ class Fritzdect extends utils.Adapter {
} else {
this.fritz
.setSimpleOn(id)
.then((sid) => {
.then(() => {
this.log.debug('Turned switch ' + id + ' on');
this.setStateAsync('DECT_' + id + '.state', {
val: true,
Expand All @@ -814,7 +815,7 @@ class Fritzdect extends utils.Adapter {
if (dp == 'blindsclose') {
this.fritz
.setBlind(id, 'close')
.then(async (sid) => {
.then(async () => {
this.log.debug('Started blind ' + id + ' to close');
await this.setStateAsync('DECT_' + id + '.blindsclose', { val: false, ack: true }); //iobroker State-Bedienung wird nochmal als Status geschrieben, da API-Aufruf erfolgreich
})
Expand All @@ -823,7 +824,7 @@ class Fritzdect extends utils.Adapter {
if (dp == 'blindsopen') {
this.fritz
.setBlind(id, 'open')
.then(async (sid) => {
.then(async () => {
this.log.debug('Started blind ' + id + ' to open');
await this.setStateAsync('DECT_' + id + '.blindsopen', { val: false, ack: true }); //iobroker State-Bedienung wird nochmal als Status geschrieben, da API-Aufruf erfolgreich
})
Expand All @@ -832,7 +833,7 @@ class Fritzdect extends utils.Adapter {
if (dp == 'blindsstop') {
this.fritz
.setBlind(id, 'stop')
.then((sid) => {
.then(() => {
this.log.debug('Set blind ' + id + ' to stop');
this.setStateAsync('DECT_' + id + '.blindsstop', { val: false, ack: true }); //iobroker State-Bedienung wird nochmal als Status geschrieben, da API-Aufruf erfolgreich
})
Expand All @@ -841,7 +842,7 @@ class Fritzdect extends utils.Adapter {
if (dp == 'level') {
this.fritz
.setLevel(id, state.val)
.then((sid) => {
.then(() => {
this.log.debug('Set level' + id + ' to ' + state.val);
this.setStateAsync('DECT_' + id + '.level', { val: state.val, ack: true }); //iobroker State-Bedienung wird nochmal als Status geschrieben, da API-Aufruf erfolgreich
})
Expand All @@ -850,7 +851,7 @@ class Fritzdect extends utils.Adapter {
if (dp == 'levelpercentage') {
this.fritz
.setLevel(id, Math.floor(Number(state.val) / 100 * 255))
.then((sid) => {
.then(() => {
//level is in 0...255
this.log.debug('Set level %' + id + ' to ' + state.val);
this.setStateAsync('DECT_' + id + '.levelpercentage', {
Expand All @@ -874,7 +875,7 @@ class Fritzdect extends utils.Adapter {
} else {
this.fritz
.setColor(id, setSaturation, state.val)
.then((sid) => {
.then(() => {
this.log.debug(
'Set lamp color hue ' +
id +
Expand Down Expand Up @@ -907,7 +908,7 @@ class Fritzdect extends utils.Adapter {
} else {
this.fritz
.setColor(id, state.val, setHue)
.then((sid) => {
.then(() => {
this.log.debug(
'Set lamp color saturation ' +
id +
Expand All @@ -930,7 +931,7 @@ class Fritzdect extends utils.Adapter {
if (dp == 'temperature') {
this.fritz
.setColorTemperature(id, state.val)
.then((sid) => {
.then(() => {
this.log.debug('Set lamp color temperature ' + id + ' to ' + state.val);
this.setStateAsync('DECT_' + id + '.temperature', {
val: state.val,
Expand Down Expand Up @@ -1041,7 +1042,7 @@ class Fritzdect extends utils.Adapter {
}
}
// const fritz = new Fritz(settings.Username, settings.Password, settings.moreParam || '', settings.strictSsl || true);

let statfeedback = {};
switch (obj.command) {
case 'devices':
try {
Expand Down Expand Up @@ -1129,7 +1130,6 @@ class Fritzdect extends utils.Adapter {
wait = true;
break;
case 'statistic':
let statfeedback = {};
try {
const deviceswithstat = await this.getStateAsync('global.statdevices').catch((e) => {
this.log.warn('problem getting statdevices ' + e);
Expand Down Expand Up @@ -1284,8 +1284,8 @@ class Fritzdect extends utils.Adapter {
this.log.debug('updating Routines ');
try {
const routineslistinfos = await fritz.getTriggerListInfos().catch((e) => this.errorHandlerApi(e));
let typ = '';
let role = '';
//let typ = '';
//let role = '';
if (routineslistinfos) {
let routines = parser.xml2json(routineslistinfos);
routines = [].concat((routines.triggerlist || {}).trigger || []).map((trigger) => {
Expand Down
Loading
Loading