mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2024-11-16 10:28:33 -07:00
Fix availability passive device timeout config. https://github.com/Koenkk/zigbee2mqtt/pull/10437
This commit is contained in:
parent
04290274b8
commit
912360c1f0
@ -19,7 +19,7 @@ export default class Availability extends Extension {
|
|||||||
|
|
||||||
const key = this.isActiveDevice(device) ? 'active' : 'passive';
|
const key = this.isActiveDevice(device) ? 'active' : 'passive';
|
||||||
const value = settings.get().availability[key]?.timeout;
|
const value = settings.get().availability[key]?.timeout;
|
||||||
return key === 'active' ? utils.minutes(value) : utils.hours(value);
|
return utils.minutes(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private isActiveDevice(device: Device): boolean {
|
private isActiveDevice(device: Device): boolean {
|
||||||
|
@ -138,7 +138,7 @@ function loadSettingsWithDefaults(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_settingsWithDefaults.availability || _settingsWithDefaults.advanced?.availability_timeout) {
|
if (_settingsWithDefaults.availability || _settingsWithDefaults.advanced?.availability_timeout) {
|
||||||
const defaults = {active: {timeout: 10}, passive: {timeout: 25}};
|
const defaults = {active: {timeout: 10}, passive: {timeout: 1500}};
|
||||||
const s = typeof _settingsWithDefaults.availability === 'object' ? _settingsWithDefaults.availability : {};
|
const s = typeof _settingsWithDefaults.availability === 'object' ? _settingsWithDefaults.availability : {};
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
_settingsWithDefaults.availability = {};
|
_settingsWithDefaults.availability = {};
|
||||||
|
Loading…
Reference in New Issue
Block a user