Skip to content

Fix Duration Selector Default#12098

Merged
balloob merged 2 commits intodevfrom
Fix-for-Duration-default
Mar 22, 2022
Merged

Fix Duration Selector Default#12098
balloob merged 2 commits intodevfrom
Fix-for-Duration-default

Conversation

@zsarnett
Copy link
Copy Markdown
Contributor

Breaking change

Proposed change

Sets the value via Value Changed event on first updated. This make sure that HA form is aware without changing any lower element functionality

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:


@property({ type: Boolean }) public required = true;

protected firstUpdated(changedProps: PropertyValues): void {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am thinking now. Should this be in will update?

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.

ha-form applies the default value if nothing is set. It's weird that we can get here and then set the duration.

I think instead in the rendering we should just do const value = this.value || "0:00:00"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We need to send the value to HA form

Copy link
Copy Markdown
Contributor Author

@zsarnett zsarnett Mar 22, 2022

Choose a reason for hiding this comment

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

Ha form doesnt default the value.

Not for selectors

That was my first thought as well

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.

@balloob balloob enabled auto-merge (squash) March 22, 2022 23:27
@balloob balloob merged commit 2d9b50d into dev Mar 22, 2022
@delete-merged-branch delete-merged-branch bot deleted the Fix-for-Duration-default branch March 22, 2022 23:33
@github-actions github-actions bot locked and limited conversation to collaborators Mar 24, 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.

3 participants