Skip to content

Commit

Permalink
fix(dingz): track changed dip config
Browse files Browse the repository at this point in the history
- invalidate config on dip change
- further fixes #118
  • Loading branch information
johannrichard committed Dec 7, 2020
1 parent 6cec9b0 commit 1cafb60
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/dingzAccessory.ts
Expand Up @@ -138,12 +138,17 @@ export class DingzAccessory extends DingzDaBaseAccessory {
dingzDevices[this.device.mac],
);

const dip_config = dingzDevices[this.device.mac].dip_config;
if (this.dingzDeviceInfo.dip_config !== dip_config) {
// DIP config has changes, invalidate config
this.device.configTimestamp = undefined;
}

// Persist updated info
this.device.hwInfo = dingzDevices[this.device.mac];
this.accessory.context.device = this.device;
this.dingzDeviceInfo = this.device.hwInfo as DingzDeviceInfo;
this.baseUrl = `http://${this.device.address}`;
this.setAccessoryInformation();
}
this.setAccessoryInformation();
this.setButtonCallbacks();
Expand Down

0 comments on commit 1cafb60

Please sign in to comment.