File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ const utils = require('@iobroker/adapter-core');
7
7
8
8
const MinPollInterval = 1000 ;
9
9
const MaxPollInterval = 60000 ;
10
- const CheckDeviceTimeoutMs = 1000 ;
10
+ const CheckDevicesTimeoutMs = 1000 ;
11
+ const CheckDevicesTimeout = 'CheckDevices' ;
11
12
12
13
class GreeHvac extends utils . Adapter {
13
14
@@ -115,16 +116,16 @@ class GreeHvac extends utils.Adapter {
115
116
}
116
117
117
118
checkDevices ( ) {
118
- this . timeouts [ 'CheckDevice' ] = this . setTimeout ( async ( ) => {
119
+ this . timeouts [ CheckDevicesTimeout ] = this . setTimeout ( async ( ) => {
119
120
const inactiveDevices = this . activeDevices . filter ( device => device . isActive === false ) ;
120
121
if ( inactiveDevices . length > 0 ) {
121
122
await this . setStateAsync ( 'info.connection' , { val : false , ack : true } ) ;
122
123
} else {
123
124
await this . setStateAsync ( 'info.connection' , { val : true , ack : true } ) ;
124
125
}
125
- this . clearTimeout ( this . timeouts [ 'CheckDevice' ] ) ;
126
+ this . clearTimeout ( this . timeouts [ CheckDevicesTimeout ] ) ;
126
127
this . checkDevices ( ) ;
127
- } , CheckDeviceTimeoutMs ) ;
128
+ } , CheckDevicesTimeoutMs ) ;
128
129
}
129
130
130
131
/**
You can’t perform that action at this time.
0 commit comments