Skip to content

Commit 32aea93

Browse files
neneonlineclaude
andcommitted
Z2M: mark custom action extend as isModernExtend
z-h-c's prepareDefinition rejects any item in a definition's `extend` array that lacks `isModernExtend: true` ("has legacy extend in modern extend"), so the raw {fromZigbee, toZigbee, exposes} block for the action converter was rejected and the whole file ignored — even after the e.presets.action fix. Add isModernExtend: true so z-h-c treats it as a modern extend and merges its fromZigbee/exposes. Verified by running every generated definition (147 full, 6 trimmed) through zigbee-herdsman-converters 26.85.0 prepareDefinition — the function Z2M's addExternalDefinition calls — with zero failures. This and the e.presets.action fix were both latent in the multistate proposal's converter, which was never regenerated or loaded, so neither was ever exercised. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 2fa58bc commit 32aea93

3 files changed

Lines changed: 1444 additions & 288 deletions

File tree

helper_scripts/templates/switch_custom.js.jinja

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,11 @@ const definitions = [
520520
{%- set _ = action_values.append(switchName ~ '_' ~ s) -%}
521521
{%- endfor -%}
522522
{%- endfor -%}
523+
// Custom modern-extend: emits the friendly `action` from the raw
524+
// multistate value. isModernExtend marks it so z-h-c merges it rather
525+
// than rejecting the definition as a legacy extend.
523526
{
527+
isModernExtend: true,
524528
fromZigbee: [{
525529
cluster: 'genMultistateInput',
526530
type: ['attributeReport', 'readResponse'],

0 commit comments

Comments
 (0)