Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-finger committed May 20, 2024
1 parent aaa54a5 commit b387158
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/googleHome.js
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,7 @@ class GoogleHome {
}
});

if (!smartName.ghAttributes && traitEnum[smartName.ghTraits[0]].defaultAttributes) {
if ((!(smartName.ghAttributes)) && (traitEnum[smartName.ghTraits[0]].defaultAttributes)) {
const defaultAttributes = traitEnum[smartName.ghTraits[0]].defaultAttributes;
result[id].attributes = JSON.parse(defaultAttributes);
const obj = await this.adapter.getForeignObjectAsync(id);
Expand All @@ -1772,7 +1772,9 @@ class GoogleHome {
});
}
} else {
result[id].attributes = {};
if (!smartName.ghAttributes) {
result[id].attributes = {};
}
}
}

Expand Down Expand Up @@ -2730,7 +2732,7 @@ class GoogleHome {
this.adapter.log.error(`[GHOME] No Google Home customData for ${dev.id} cannot handle Google Request.`);
}
//Workaround for no thermostat mode available
if (responseDev[dev.id].thermostatTemperatureSetpoint) {
if (responseDev[dev.id].thermostatTemperatureSetpoint && responseDev[dev.id].thermostatMode === undefined) {
if (responseDev[dev.id].thermostatTemperatureAmbient > responseDev[dev.id].thermostatTemperatureSetpoint) {
responseDev[dev.id].thermostatMode = 'cool';
} else {
Expand Down

0 comments on commit b387158

Please sign in to comment.