mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2024-11-16 18:39:09 -07:00
Support WXKG02LM. #4
This commit is contained in:
parent
5b52defe9e
commit
4d3d15f5b9
@ -10,6 +10,12 @@ const battery = {
|
||||
max: 3000,
|
||||
}
|
||||
|
||||
const WXKG02LM = {
|
||||
1: 'left',
|
||||
2: 'right',
|
||||
3: 'both',
|
||||
};
|
||||
|
||||
const toPercentage = (value, min, max) => {
|
||||
if (value > max) {
|
||||
value = max;
|
||||
@ -156,7 +162,13 @@ const parsers = [
|
||||
type: 'attReport',
|
||||
convert: (msg) => {return {pressure: msg.data.data['measuredValue']}}
|
||||
},
|
||||
|
||||
{
|
||||
devices: ['WXKG02LM'],
|
||||
cid: 'genOnOff',
|
||||
type: 'attReport',
|
||||
convert: (msg) => {return {click: WXKG02LM[msg.endpoints[0].epId]}}
|
||||
},
|
||||
|
||||
|
||||
// Ignore parsers (these message dont need parsing).
|
||||
{
|
||||
|
@ -82,6 +82,15 @@ const homeassistant = {
|
||||
json_attributes: ['battery'],
|
||||
}
|
||||
},
|
||||
'sensor_button': {
|
||||
type: 'sensor',
|
||||
object_id: 'button',
|
||||
discovery_payload: {
|
||||
icon: 'mdi:toggle-switch',
|
||||
value_template: '{{ value_json.click }}',
|
||||
json_attributes: ['battery'],
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const devices = {
|
||||
@ -97,6 +106,13 @@ const devices = {
|
||||
description: 'Aqara wireless switch',
|
||||
supports: 'single, double, triple, quadruple click',
|
||||
},
|
||||
'lumi.sensor_86sw2\u0000Un': {
|
||||
model: 'WXKG02LM',
|
||||
vendor: 'Xiaomi',
|
||||
description: 'Aqara double key wireless wall switch',
|
||||
supports: 'left, right and both click',
|
||||
homeassistant: [homeassistant.sensor_button]
|
||||
},
|
||||
'lumi.sens': {
|
||||
model: 'WSDCGQ01LM',
|
||||
vendor: 'Xiaomi',
|
||||
|
@ -22,12 +22,6 @@ const plannedToSupport = [
|
||||
supports: '-',
|
||||
vendor: 'Xiaomi',
|
||||
},
|
||||
{
|
||||
model: 'WXKG02LM',
|
||||
description: 'Aqara double key wireless wall switch',
|
||||
supports: '-',
|
||||
vendor: 'Xiaomi',
|
||||
},
|
||||
{
|
||||
model: 'QBKG11LM',
|
||||
description: 'Aqara single key wired wall switch',
|
||||
|
Loading…
Reference in New Issue
Block a user