Skip to content

Commit

Permalink
Merge pull request #9 from baranwang/fix/open-error
Browse files Browse the repository at this point in the history
fix: 打开空调时没有正确启动
  • Loading branch information
baranwang authored Feb 11, 2024
2 parents b96f309 + f7a9c07 commit 5b06078
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/plugin/src/accessories/air-conditioner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class AirConditionerAccessory extends BaseAccessory {
};
const operationMode = modeMap[value as number];
if (operationMode) {
await this.sendCommands({ operationMode });
await this.sendCommands({ onOffStatus: 'true' }, { operationMode });
return;
}
this.platform.log.warn('Unsupported TargetHeatingCoolingState:', value);
Expand Down
6 changes: 1 addition & 5 deletions packages/plugin/src/accessories/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,8 @@ export class BaseAccessory {

protected async getDevDigitalModel() {
const { deviceId, isOnline } = this.accessory.context.deviceInfo.baseInfo;
// TODO: 待测试
if (!isOnline) {
this.accessory
.getService(this.platform.Service.AccessoryInformation)!
.getCharacteristic(this.platform.Characteristic.Model)
.updateValue(new Error(this.platform.api.hap.HAPStatus.SERVICE_COMMUNICATION_FAILURE as any));
this.platform.log.warn('设备', this.accessory.displayName, '离线');
}
try {
if (!this.devDigitalModelPromise) {
Expand Down

0 comments on commit 5b06078

Please sign in to comment.