Skip to content

Commit

Permalink
fix: Add event listeners for entity type selection for NR 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zachowj committed Jun 26, 2024
1 parent 179b24a commit 9ea63cf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/nodes/entity-config/editor/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9ea63cf

Please sign in to comment.