Skip to content

Conversation

@Koenkk
Copy link
Owner

@Koenkk Koenkk commented Dec 30, 2025

This PR enables the automatic reconfigure based on the new configureKey introduced in Koenkk/zigbee-herdsman-converters#11148. Note that the automatic re-configure was disabled before in #22088 but since it will now be stable (configureKey will only change when strictly necessary) it can be enabled again.

@Koenkk Koenkk requested a review from Nerivec December 30, 2025 20:59
Comment on lines +102 to +109
const shouldReconfigure =
// Should always reconfigure when not configured before
device.zh.meta?.configured === undefined ||
// Or should reconfigure when configureKey is not the default one (0) and differs from last configured configureKey
// In older z2m versions the stored configureKey (meta.configured) was the hash of the configure function.
// Since we don't want to reconfigure all devices, we don't re-configure when a device has the default configureKey of 0.
(configureKey !== 0 && device.zh.meta?.configured !== configureKey);
if (!shouldReconfigure) return;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not easy to read. Should bracket the if (follows most cases in Z2M/ZH) or at least add a new line to separate the two.

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.

3 participants