Skip to content

Commit

Permalink
fix(api): consider damper state in zone fan status
Browse files Browse the repository at this point in the history
the fan status shows as low/med/high even when the damper is closed and the zone is getting no air

fixes #156
  • Loading branch information
grivkees committed Mar 20, 2022
1 parent 79b4ff8 commit 9462004
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"clsp",
"cmode",
"ctype",
"damperposition",
"Fanv",
"filtrlvl",
"featureset",
Expand Down
8 changes: 7 additions & 1 deletion src/infinityApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ interface Zone {
activities?: ZoneActivity[];
program?: ZoneProgram[];
zoneconditioning?: string[];
damperposition?: string[];
}

class OAuthHeaders {
Expand Down Expand Up @@ -366,7 +367,12 @@ export class InfinityEvolutionSystemStatus extends BaseInfinityEvolutionSystemAp
}

async getZoneFan(zone: string): Promise<string> {
return (await this.getZone(zone)).fan[0];
const zone_obj = await this.getZone(zone);
if (zone_obj.damperposition![0] === '0') {
return FAN_MODE.OFF;
} else {
return zone_obj.fan[0];
}
}

async getZoneTemp(zone: string): Promise<number> {
Expand Down

0 comments on commit 9462004

Please sign in to comment.