Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recognition improvement for Lonsonho X702A #8156

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

marcinsu
Copy link
Contributor

@marcinsu marcinsu commented Oct 19, 2024

Hello
I added custom converter to add the option of LED indicator. Everything works fine the same as the X702A version (similar to #6117 )

const {actionEnumLookup,commandsOnOff,deviceEndpointsidentify,onOff} = require('zigbee-herdsman-converters/lib/modernExtend');
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const ota = require('zigbee-herdsman-converters/lib/ota');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');


const definition = {
        fingerprint: tuya.fingerprint('TS0001', ['_TZ3000_t3s9qmmg']),
        model: 'X701A',
        vendor: 'Lonsonho',
        description: '1 gang switch with backlight',
        extend: [tuya.modernExtend.tuyaOnOff({indicatorMode: true})],
        configure: async (device, coordinatorEndpoint) => {
            await tuya.configureMagicPacket(device, coordinatorEndpoint);
            await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
        },
        whiteLabel: [
            tuya.whitelabel('Lonsonho', 'X701A', '1 gang switch with backlight', ['_TZ3000_t3s9qmmg'])
        ]
};

module.exports = definition;

It is looks the same as https://www.zigbee2mqtt.io/devices/X711A.html

image

adding led indicator option
Recognition improvement for Lonsonho X702A
@@ -3653,6 +3653,20 @@ const definitions: DefinitionWithExtend[] = [
await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
},
},
{
zigbeeModel: ['TS0001'],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
zigbeeModel: ['TS0001'],
fingerprint: tuya.fingerprint('TS0001', ['_TZ3000_t3s9qmmg']),

description: '1 gang switch with backlight',
extend: [tuya.modernExtend.tuyaOnOff({indicatorMode: true})],
whiteLabel: [
tuya.whitelabel('Lonsonho', 'X701A', '1 gang switch with backlight', ['_TZ3000_t3s9qmmg']),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed

{
zigbeeModel: ['TS0001'],
model: 'X701A',
vendor: 'Lonsonho',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please modify lonsonho.ts instead of tuya.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants