diff --git a/src/platform.ts b/src/platform.ts index 91dce8b..13d1731 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -58,7 +58,7 @@ export class WeatherFlowTempestPlatform implements DynamicPlatformPlugin { wind_chill: 0, dew_point: 0, lightning_strike_last_epoch: 0, - lightning_strike_last_distance: 0 + lightning_strike_last_distance: 0, }; this.tempest_battery_level = 0; diff --git a/src/platformAccessory.ts b/src/platformAccessory.ts index b2af65d..3e226c9 100644 --- a/src/platformAccessory.ts +++ b/src/platformAccessory.ts @@ -639,9 +639,9 @@ class ContactSensor { const current_epoch_now = Math.floor(Date.now() / 1000); if (lightning_strike_last_epoch > 0 && lightning_strike_last_distance > 0 - && lightning_strike_last_distance <= trigger_distance + && lightning_strike_last_distance <= trigger_distance && (current_epoch_now - lightning_strike_last_epoch) <= trigger_time) { - return 1; // trigger CONTACT_NOT_DETECTED. + return 1; // trigger CONTACT_NOT_DETECTED. } return 0; } catch(exception) { @@ -652,7 +652,7 @@ class ContactSensor { } /** - * + * */ private handleCurrentStateGet(): number { diff --git a/src/tempest.ts b/src/tempest.ts index 71b4116..3006139 100644 --- a/src/tempest.ts +++ b/src/tempest.ts @@ -63,7 +63,7 @@ export class TempestSocket { uv: 0, brightness: 0, lightning_strike_last_epoch: 0, - lightning_strike_last_distance: 0 + lightning_strike_last_distance: 0, }; this.tempest_battery_level = 0; this.s = dgram.createSocket({ type: 'udp4', reuseAddr: reuse_address });