Skip to content

Commit

Permalink
show Rates on device tab
Browse files Browse the repository at this point in the history
  • Loading branch information
donavanbecker committed Nov 27, 2024
1 parent 1438ac5 commit 6fbede3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"icon": "https://raw.githubusercontent.com/OpenWonderLabs/homebridge-switchbot/latest/branding/icon.png",
"engineStrict": true,
"engines": {
"homebridge": "^1.8.5 || ^2.0.0 || ^2.0.0-beta.22 || ^2.0.0-alpha.37",
"homebridge": "^1.8.5 || ^2.0.0 || ^2.0.0-beta.23 || ^2.0.0-alpha.37",
"node": "^20 || ^22"
},
"scripts": {
Expand Down
3 changes: 3 additions & 0 deletions src/device/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,15 @@ export abstract class deviceBase {
// refreshRate
this.deviceRefreshRate = device.refreshRate ?? this.platform.platformRefreshRate ?? 300
const refreshRate = device.refreshRate ? 'Device Config' : this.platform.platformRefreshRate ? 'Platform Config' : 'Default'
this.accessory.context.refreshRate = this.deviceRefreshRate
// updateRate
this.deviceUpdateRate = device.updateRate ?? this.platform.platformUpdateRate ?? 5
const updateRate = device.updateRate ? 'Device Config' : this.platform.platformUpdateRate ? 'Platform Config' : 'Default'
this.accessory.context.updateRate = this.deviceUpdateRate
// pushRate
this.devicePushRate = device.pushRate ?? this.platform.platformPushRate ?? 0.1
const pushRate = device.pushRate ? 'Device Config' : this.platform.platformPushRate ? 'Platform Config' : 'Default'
this.accessory.context.pushRate = this.devicePushRate
this.debugLog(`Using ${refreshRate} refreshRate: ${this.deviceRefreshRate}, ${updateRate} updateRate: ${this.deviceUpdateRate}, ${pushRate} pushRate: ${this.devicePushRate}`)
// maxRetries
this.deviceMaxRetries = device.maxRetries ?? this.platform.platformMaxRetries ?? 2
Expand Down
3 changes: 3 additions & 0 deletions src/homebridge-ui/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ <h5>Help/About</h5>
document.getElementById('version').innerHTML = context.version;
document.getElementById('deviceType').innerHTML = context.deviceType;
document.getElementById('connectionType').innerHTML = context.connectionType;
document.getElementById('refreshRate').innerHTML = context.refreshRate;
document.getElementById('updateRate').innerHTML = context.updateRate;
document.getElementById('pushRate').innerHTML = context.pushRate;
document.getElementById('deviceTable').style.display = 'inline-table';
homebridge.hideSpinner();
};
Expand Down
3 changes: 3 additions & 0 deletions src/irdevice/irdevice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,15 @@ export abstract class irdeviceBase {
// refreshRate
this.deviceRefreshRate = device.refreshRate ?? this.platform.platformRefreshRate ?? 300
const refreshRate = device.refreshRate ? 'Device Config' : this.platform.platformRefreshRate ? 'Platform Config' : 'Default'
this.accessory.context.refreshRate = this.deviceRefreshRate
// updateRate
this.deviceUpdateRate = device.updateRate ?? this.platform.platformUpdateRate ?? 5
const updateRate = device.updateRate ? 'Device Config' : this.platform.platformUpdateRate ? 'Platform Config' : 'Default'
this.accessory.context.updateRate = this.deviceUpdateRate
// pushRate
this.devicePushRate = device.pushRate ?? this.platform.platformPushRate ?? 0.1
const pushRate = device.pushRate ? 'Device Config' : this.platform.platformPushRate ? 'Platform Config' : 'Default'
this.accessory.context.pushRate = this.devicePushRate
this.debugLog(`Using ${refreshRate} refreshRate: ${this.deviceRefreshRate}, ${updateRate} updateRate: ${this.deviceUpdateRate}, ${pushRate} pushRate: ${this.devicePushRate}`)
// maxRetries
this.deviceMaxRetries = device.maxRetries ?? this.platform.platformMaxRetries ?? 2
Expand Down

0 comments on commit 6fbede3

Please sign in to comment.