@@ -233,7 +233,7 @@ describe('Bridge', () => {
233
233
234
234
it ( 'Should publish devices on startup' , async ( ) => {
235
235
await resetExtension ( ) ;
236
- // console.log(MQTT.publish.mock.calls.find((c) => c[0] === 'zigbee2mqtt/bridge/devices')[1])
236
+ // console.log(MQTT.publish.mock.calls.find((c) => c[0] === 'zigbee2mqtt/bridge/devices')[1]);
237
237
expect ( MQTT . publish ) . toHaveBeenCalledWith (
238
238
'zigbee2mqtt/bridge/devices' ,
239
239
stringify ( [
@@ -318,6 +318,41 @@ describe('Bridge', () => {
318
318
value_max : 454 ,
319
319
value_min : 250 ,
320
320
} ,
321
+ {
322
+ access : 7 ,
323
+ description : 'Configure genLevelCtrl' ,
324
+ features : [
325
+ {
326
+ access : 7 ,
327
+ description :
328
+ 'this setting can affect the "on_level", "current_level_startup" or "brightness" setting' ,
329
+ label : 'Execute if off' ,
330
+ name : 'execute_if_off' ,
331
+ property : 'execute_if_off' ,
332
+ type : 'binary' ,
333
+ value_off : false ,
334
+ value_on : true ,
335
+ } ,
336
+ {
337
+ access : 7 ,
338
+ description : 'Defines the desired startup level for a device when it is supplied with power' ,
339
+ label : 'Current level startup' ,
340
+ name : 'current_level_startup' ,
341
+ presets : [
342
+ { description : 'Use minimum permitted value' , name : 'minimum' , value : 0 } ,
343
+ { description : 'Use previous value' , name : 'previous' , value : 255 } ,
344
+ ] ,
345
+ property : 'current_level_startup' ,
346
+ type : 'numeric' ,
347
+ value_max : 254 ,
348
+ value_min : 1 ,
349
+ } ,
350
+ ] ,
351
+ label : 'Level config' ,
352
+ name : 'level_config' ,
353
+ property : 'level_config' ,
354
+ type : 'composite' ,
355
+ } ,
321
356
] ,
322
357
type : 'light' ,
323
358
} ,
@@ -1878,6 +1913,41 @@ describe('Bridge', () => {
1878
1913
value_max : 454 ,
1879
1914
value_min : 250 ,
1880
1915
} ,
1916
+ {
1917
+ access : 7 ,
1918
+ description : 'Configure genLevelCtrl' ,
1919
+ features : [
1920
+ {
1921
+ access : 7 ,
1922
+ description :
1923
+ 'this setting can affect the "on_level", "current_level_startup" or "brightness" setting' ,
1924
+ label : 'Execute if off' ,
1925
+ name : 'execute_if_off' ,
1926
+ property : 'execute_if_off' ,
1927
+ type : 'binary' ,
1928
+ value_off : false ,
1929
+ value_on : true ,
1930
+ } ,
1931
+ {
1932
+ access : 7 ,
1933
+ description : 'Defines the desired startup level for a device when it is supplied with power' ,
1934
+ label : 'Current level startup' ,
1935
+ name : 'current_level_startup' ,
1936
+ presets : [
1937
+ { description : 'Use minimum permitted value' , name : 'minimum' , value : 0 } ,
1938
+ { description : 'Use previous value' , name : 'previous' , value : 255 } ,
1939
+ ] ,
1940
+ property : 'current_level_startup' ,
1941
+ type : 'numeric' ,
1942
+ value_max : 254 ,
1943
+ value_min : 1 ,
1944
+ } ,
1945
+ ] ,
1946
+ label : 'Level config' ,
1947
+ name : 'level_config' ,
1948
+ property : 'level_config' ,
1949
+ type : 'composite' ,
1950
+ } ,
1881
1951
] ,
1882
1952
type : 'light' ,
1883
1953
} ,
@@ -2186,7 +2256,7 @@ describe('Bridge', () => {
2186
2256
await zigbeeHerdsman . events . deviceInterview ( { device : zigbeeHerdsman . devices . unsupported , status : 'successful' } ) ;
2187
2257
await flushPromises ( ) ;
2188
2258
expect ( MQTT . publish ) . toHaveBeenCalledTimes ( 7 ) ;
2189
- // console.log(MQTT.publish.mock.calls.filter((c) => c[0] === 'zigbee2mqtt/bridge/event'))
2259
+ // console.log(MQTT.publish.mock.calls.filter((c) => c[0] === 'zigbee2mqtt/bridge/event'));
2190
2260
expect ( MQTT . publish ) . toHaveBeenCalledWith (
2191
2261
'zigbee2mqtt/bridge/event' ,
2192
2262
stringify ( {
@@ -2254,6 +2324,40 @@ describe('Bridge', () => {
2254
2324
value_max : 454 ,
2255
2325
value_min : 250 ,
2256
2326
} ,
2327
+ {
2328
+ access : 7 ,
2329
+ description : 'Configure genLevelCtrl' ,
2330
+ features : [
2331
+ {
2332
+ access : 7 ,
2333
+ description : `this setting can affect the "on_level", "current_level_startup" or "brightness" setting` ,
2334
+ label : 'Execute if off' ,
2335
+ name : 'execute_if_off' ,
2336
+ property : 'execute_if_off' ,
2337
+ type : 'binary' ,
2338
+ value_off : false ,
2339
+ value_on : true ,
2340
+ } ,
2341
+ {
2342
+ access : 7 ,
2343
+ description : 'Defines the desired startup level for a device when it is supplied with power' ,
2344
+ label : 'Current level startup' ,
2345
+ name : 'current_level_startup' ,
2346
+ presets : [
2347
+ { description : 'Use minimum permitted value' , name : 'minimum' , value : 0 } ,
2348
+ { description : 'Use previous value' , name : 'previous' , value : 255 } ,
2349
+ ] ,
2350
+ property : 'current_level_startup' ,
2351
+ type : 'numeric' ,
2352
+ value_max : 254 ,
2353
+ value_min : 1 ,
2354
+ } ,
2355
+ ] ,
2356
+ label : 'Level config' ,
2357
+ name : 'level_config' ,
2358
+ property : 'level_config' ,
2359
+ type : 'composite' ,
2360
+ } ,
2257
2361
] ,
2258
2362
type : 'light' ,
2259
2363
} ,
0 commit comments