-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[Refactoring][Part 2] Updating Lumi (Aqara and Xiaomi) specific converters #6982
Conversation
yes
as minimal as possible
what do you mean? |
I mean that right now they mostly don't work if legacy mode is not enabled. Like here: lumi_buttons: {
cluster: 'genOnOff',
type: ['attributeReport'],
options: [exposes.options.legacy()],
convert: (model, msg, publish, options, meta) => {
if (isLegacyEnabled(options)) {
const mapping: KeyValueAny = {4: 'left', 5: 'right'};
const button = mapping[msg.endpoint.ID];
if (button) {
const payload: KeyValueAny = {};
payload[`button_${button}`] = msg.data['onOff'] === 1 ? 'release' : 'hold';
return payload;
}
}
},
} satisfies Fz.Converter But most importantly, what are the general differences between normal and legacy converters and how to update them? |
These converters were kept to prevent a breaking change, therefore these were moved to legacy. On new installations |
I've merged them all into non legacy ones. Does this look reasonable or they should be kept is separate but consolidated legacy converters? |
Let's leave all legacy in |
@Koenkk left legacy alone but moved to Moved all Lumi related converters Merged a lot of conflicts, hopefully without regressions. Let me know if I can help with code review in some way as it's and enormous diff. |
ThankS! |
TODO
lib/legacy.ts
,converters/fromZigbee.ts
andconverters/toZigbee.ts
tolib/lumi.ts
devices/lumi.ts
lumi_*
legacy
convertersQuestions and thoughts
legacy
functions be updated?