Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-finger committed Dec 27, 2024
1 parent 8e44edb commit b76622d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/googleHome.js
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,7 @@ class GoogleHome {
} catch (error) {}
});

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 @@ -1793,7 +1793,9 @@ class GoogleHome {
});
}
} else {
result[id].attributes = {};
if (!smartName.ghAttributes) {
result[id].attributes = {};
}
}
}

Expand Down Expand Up @@ -2904,11 +2906,8 @@ class GoogleHome {
);
}
//Workaround for no thermostat mode available
if (responseDev[dev.id].thermostatTemperatureSetpoint) {
if (
responseDev[dev.id].thermostatTemperatureAmbient >
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 {
responseDev[dev.id].thermostatMode = 'heat';
Expand Down

0 comments on commit b76622d

Please sign in to comment.