Skip to content

Commit

Permalink
Fix wrong discovery of zoneSensor
Browse files Browse the repository at this point in the history
  • Loading branch information
bimusiek committed Feb 28, 2024
1 parent 338ff2e commit 7f7b266
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"files.eol": "\n",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"editor.rulers": [ 140 ],
"eslint.enable": true
Expand Down
6 changes: 3 additions & 3 deletions src/accessories/thermostatAccessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class ThermostatAccessory extends Accessory<DeviceContext> {
private ecoModeService: Service | undefined;
private comfortModeService: Service | undefined;
private readonly isCoolModeEnabled: boolean;
private readonly zoneSensor: 'internal' | 'Water temperature';
private readonly zoneSensor: 'Internal' | 'Water temperature';
private readonly hasWaterTank: boolean;

constructor(
Expand Down Expand Up @@ -129,7 +129,7 @@ export class ThermostatAccessory extends Accessory<DeviceContext> {
return;
}
const parsedTemp = parseInt(temp as string);
const adjustedTemp = this.zoneSensor === 'internal' ? parsedTemp : parsedTemp - readings.temperatureNow;
const adjustedTemp = this.zoneSensor === 'Internal' ? parsedTemp : parsedTemp - readings.temperatureNow;

try {
this.panasonicApi.setZoneTemp(this.accessory.context.device.uniqueId,
Expand Down Expand Up @@ -252,7 +252,7 @@ export class ThermostatAccessory extends Accessory<DeviceContext> {
}

private updateTargetTemperaturePropsAndReturnCurrentTemp({ targetTempMin, targetTempMax, targetTempSet, temperatureNow }: DeviceDetails) {
if(this.zoneSensor === 'internal') {
if(this.zoneSensor === 'Internal') {
this.service.getCharacteristic(this.platform.Characteristic.TargetTemperature).setProps({
minValue: targetTempMin,
maxValue: targetTempMax,
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface Device {
displayName: string;
isCoolModeEnabled: boolean;
hasWaterTank: boolean;
zoneSensor: 'internal' | 'Water temperature';
zoneSensor: 'Internal' | 'Water temperature';
}

export interface DeviceContext {
Expand Down

0 comments on commit 7f7b266

Please sign in to comment.