diff --git a/package.json b/package.json index 17f01ab7..e08b66ba 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/device/device.ts b/src/device/device.ts index 02ca1779..05784a22 100644 --- a/src/device/device.ts +++ b/src/device/device.ts @@ -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 diff --git a/src/homebridge-ui/public/index.html b/src/homebridge-ui/public/index.html index 06223ab4..709adb3e 100644 --- a/src/homebridge-ui/public/index.html +++ b/src/homebridge-ui/public/index.html @@ -171,6 +171,9 @@
Help/About
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(); }; diff --git a/src/irdevice/irdevice.ts b/src/irdevice/irdevice.ts index 4552860d..ecf7dad1 100644 --- a/src/irdevice/irdevice.ts +++ b/src/irdevice/irdevice.ts @@ -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