Skip to content

Commit

Permalink
fix: error while setting target temperature if thermostat is set to O…
Browse files Browse the repository at this point in the history
…FF from physical controls and cache hasn't been updated yet
  • Loading branch information
nyirsh committed Jan 2, 2024
1 parent 4d542f1 commit c0d80c5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/accessory/thermostat-accessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,12 @@ export default class ThermostatAccessory extends BaseAccessory {
}
const units = maybeTemp.value.scale.toLowerCase() as TemperatureScale;
const newTemp = tempMapper.mapHomeKitTempToAlexa(value, units);
try {
const userSelectedState = await this.handleTargetStateGet();
await this.handleTargetStateSet(userSelectedState);
} catch (e) {
this.logWithContext('debug', 'Attempting to reset thermostat state failure, this might not be an issue');
}
return pipe(
this.platform.alexaApi.setDeviceState(
this.device.id,
Expand Down

0 comments on commit c0d80c5

Please sign in to comment.