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 X701A #8156

Merged
merged 7 commits into from
Dec 2, 2024
Merged

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, moved to lonsonho.ts.

@Koenkk
Copy link
Owner

Koenkk commented Dec 2, 2024

Thanks!

Could you also submit a picture for the docs? This can be done by:

  1. Create a fork by clicking here
  2. Go to the public/images/devices directory, Add file -> Upload files
  3. Upload the files and press Commit changes
  4. Press Contribute -> Open pull request -> update title/description -> Create pull request

Make sure that:

@Koenkk Koenkk merged commit 5478391 into Koenkk:master Dec 2, 2024
2 checks passed
@Koenkk
Copy link
Owner

Koenkk commented Dec 2, 2024

Thanks!

@marcinsu marcinsu changed the title Recognition improvement for Lonsonho X702A Recognition improvement for Lonsonho X701A Dec 2, 2024
@marcinsu
Copy link
Contributor Author

marcinsu commented Dec 2, 2024

Done: Koenkk/zigbee2mqtt.io#3281

Thanks for help with PR changes :)

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