Skip to content

Allow device actions to specify extra fields#4002

Merged
bramkragten merged 3 commits into
home-assistant:devfrom
emontnemery:automation_device_action_form
Oct 14, 2019
Merged

Allow device actions to specify extra fields#4002
bramkragten merged 3 commits into
home-assistant:devfrom
emontnemery:automation_device_action_form

Conversation

@emontnemery
Copy link
Copy Markdown
Collaborator

@emontnemery emontnemery commented Oct 14, 2019

Allow device actions to specify extra fields which will then be shown in the UI using ha-form.

This is same as #3970 but for actions.

Comment thread src/panels/config/js/script/device.tsx Outdated
}

public componentDidUpdate(prevProps) {
if (prevProps.action !== this.props.action) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should use the deviceAutomationsEqual function here (also on the others btw)

});

const whitelist = ["above", "below", "for"];
const whitelist = ["above", "below", "code", "for"];
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This might get a bit out of hand..
Maybe it would be better to pass the automation's extra_fields list to deviceAutomationsEqual instead?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, agree

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The problem is just that HaDeviceAutomationPicker doesn't know about the extra fields right now.

@bramkragten bramkragten merged commit 555b746 into home-assistant:dev Oct 14, 2019
@bramkragten bramkragten mentioned this pull request Oct 23, 2019
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants