Skip to content

Commit

Permalink
Parse also "type" field from get_demand_control response
Browse files Browse the repository at this point in the history
  • Loading branch information
Matze2 committed Sep 28, 2024
1 parent 43da0e1 commit 79afa3c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/models/DemandControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import { DaikinDataParser, ResponseDict } from '../DaikinDataParser';
import { DaikinResponseCb } from '../DaikinACRequest';

export class DemandControl {
public type?: number;
public enabled?: boolean;
public mode?: number;
public maxPower?: number;

// ret=OK,type=1,en_demand=1,mode=0,max_pow=55,scdl_per_day=4,moc=0,tuc=0,wec=0,thc=0,frc=0,sac=0,suc=0
public static parseResponse(dict: ResponseDict, cb: DaikinResponseCb<DemandControl>): void {
const result = new DemandControl();
result.type = DaikinDataParser.resolveInteger(dict, 'type');
result.enabled = DaikinDataParser.resolveBool(dict, 'en_demand');
result.mode = DaikinDataParser.resolveInteger(dict, 'mode');
result.maxPower = DaikinDataParser.resolveInteger(dict, 'max_pow');
Expand Down

0 comments on commit 79afa3c

Please sign in to comment.