From 9ea63cf36e0031fffba5d4b07d4e77c75ff9b896 Mon Sep 17 00:00:00 2001 From: Jason <37859597+zachowj@users.noreply.github.com> Date: Wed, 26 Jun 2024 16:09:43 -0700 Subject: [PATCH] fix: Add event listeners for entity type selection for NR 4.0 --- src/nodes/entity-config/editor/helpers.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/nodes/entity-config/editor/helpers.ts b/src/nodes/entity-config/editor/helpers.ts index 702539d8c9..9b8772cfc0 100644 --- a/src/nodes/entity-config/editor/helpers.ts +++ b/src/nodes/entity-config/editor/helpers.ts @@ -197,6 +197,12 @@ export const saveEntityType = ( type: EntityType, selector: EntityTypeSelector = 'entityConfig', ) => { + // For Node-RED 4.0+ + $(`#node-input-btn-${selector}-add`).on('click', function () { + $('body').data('haEntityType', type); + }); + // For Node-RED proir to 4.0 + // TODO: Remove this when Node-RED 4.0 is the minimum version $(`#node-input-lookup-${selector}`).on('click', function () { if ($(`#node-input-${selector}`).val() === '_ADD_') { $('body').data('haEntityType', type);