Skip to content

Commit

Permalink
feat: Expose uart_connection and uart_baud_rate for WB-MSW-ZIGBEE…
Browse files Browse the repository at this point in the history
… v.4 (#8616)
  • Loading branch information
BurchuMikhail authored Jan 15, 2025
1 parent ef7ac30 commit b33bc18
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/devices/wirenboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,35 @@ const sprutModernExtend = {
entityCategory: 'config',
...args,
}),
sprutIsConnected: (args?: Partial<modernExtend.BinaryArgs>) =>
modernExtend.binary({
name: 'uart_connection',
cluster: 'sprutDevice',
attribute: 'isConnected',
valueOn: [true, 1],
valueOff: [false, 0],
description: 'Indicates whether the device is communicating with sensors via UART',
access: 'STATE_GET',
entityCategory: 'diagnostic',
...args,
}),
sprutUartBaudRate: (args?: Partial<modernExtend.EnumLookupArgs>) =>
modernExtend.enumLookup({
name: 'uart_baud_rate',
lookup: {
'9600': 9600,
'19200': 19200,
'38400': 38400,
'57600': 57600,
'115200': 115200,
},
cluster: 'sprutDevice',
attribute: 'UartBaudRate',
description: 'UART baud rate',
access: 'ALL',
entityCategory: 'config',
...args,
}),
sprutTemperatureOffset: (args?: Partial<modernExtend.NumericArgs>) =>
modernExtend.numeric({
name: 'temperature_offset',
Expand Down Expand Up @@ -442,6 +471,8 @@ const sprutModernExtend = {

const {
sprutActivityIndicator,
sprutIsConnected,
sprutUartBaudRate,
sprutOccupancyLevel,
sprutNoise,
sprutVoc,
Expand Down Expand Up @@ -610,6 +641,7 @@ const definitions: DefinitionWithExtend[] = [
}),
onOff({powerOnBehavior: false, endpointNames: ['l1', 'l2', 'l3']}),
sprutActivityIndicator({endpointName: 'indicator'}),
sprutIsConnected(),
temperature(),
sprutTemperatureOffset(),
humidity(),
Expand All @@ -626,6 +658,7 @@ const definitions: DefinitionWithExtend[] = [
sprutNoiseTimeout(),
sprutVoc(),
sprutIrBlaster(),
sprutUartBaudRate(),
],
ota: true,
},
Expand Down

0 comments on commit b33bc18

Please sign in to comment.