Skip to content

Commit

Permalink
* (Apollon77) Prevented some error logs and fix internal flow issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 committed Feb 4, 2024
1 parent cc934a4 commit cf94f13
Show file tree
Hide file tree
Showing 4 changed files with 256 additions and 133 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ After the Adapter has connected to the Daikin Device a structure of objects are
* VIS widget

## Changelog
### __WORK IN PROGRESS__
* (Apollon77) Prevented some error logs and fix internal flow issues

### 1.4.2 (2022-07-25)
* (Apollon77) Make sure polling still works after setting special mode states

Expand Down
18 changes: 11 additions & 7 deletions daikin.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,9 @@ async function storeDaikinData(err) {
deviceName = `${daikinDevice.currentCommonBasicInfo.name} `;
}

const controlInfo = daikinDevice.currentACControlInfo;
const controlInfo = {
...daikinDevice.currentACControlInfo
};
const control = {};
for (const fieldName in fieldDef.control) {
if (controlInfo[fieldName] !== undefined) {
Expand Down Expand Up @@ -522,16 +524,18 @@ async function storeDaikinData(err) {
}
}

const basicInfo = daikinDevice.currentCommonBasicInfo;
const basicInfo = {
...daikinDevice.currentCommonBasicInfo
};
if (basicInfo && basicInfo.power !== undefined) {
delete basicInfo.power;
}

updated += handleDaikinUpdate(basicInfo, 'deviceInfo');
updated += handleDaikinUpdate(daikinDevice.currentACModelInfo, 'modelInfo');
updated += handleDaikinUpdate(control, 'control');
updated += handleDaikinUpdate(controlInfo, 'controlInfo');
updated += handleDaikinUpdate(daikinDevice.currentACSensorInfo, 'sensorInfo');
updated += await handleDaikinUpdate(basicInfo, 'deviceInfo');
updated += await handleDaikinUpdate(daikinDevice.currentACModelInfo, 'modelInfo');
updated += await handleDaikinUpdate(control, 'control');
updated += await handleDaikinUpdate(controlInfo, 'controlInfo');
updated += await handleDaikinUpdate(daikinDevice.currentACSensorInfo, 'sensorInfo');
if (updated > 0) {
adapter.log.info(`${updated} Values updated`);
}
Expand Down
Loading

0 comments on commit cf94f13

Please sign in to comment.