Skip to content

Options flow for Monoprice sources#33156

Merged
balloob merged 2 commits into
home-assistant:devfrom
OnFreund:monoprice_options_flow
Mar 24, 2020
Merged

Options flow for Monoprice sources#33156
balloob merged 2 commits into
home-assistant:devfrom
OnFreund:monoprice_options_flow

Conversation

@OnFreund
Copy link
Copy Markdown
Contributor

@OnFreund OnFreund commented Mar 22, 2020

Proposed change

Following up on the recent changes to the Monoprice integration, this PR enables the use of options flow to reconfigure sources.

Type of change

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

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

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

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

@probot-home-assistant
Copy link
Copy Markdown

Hey there @etsinko, mind taking a look at this pull request as its been labeled with a integration (monoprice) you are listed as a codeowner for? Thanks!

@OnFreund
Copy link
Copy Markdown
Contributor Author

OnFreund commented Mar 22, 2020

@balloob @MartinHjelmare this is the options flow followup we discussed in #30337.

One problem I'm not sure how to resolve - since the options flow uses the Voluptuous default parameter to pre-fill the existing values, the only way to remove a value is to put a whitespace string (e.g. a single space) instead of it. Simply removing it keeps the old value in place.
Any idea how to resolve this?

Also, I think this integration is now a candidate for Gold on the quality scale. What do you think?

Copy link
Copy Markdown
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

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

This looks ok. I don't have a solution for being able to remove an optional value. I know that we recently made a change for something similar in the frontend, but I can't recall nor find it, so I don't know if I am imagining it.

@balloob balloob merged commit b50281a into home-assistant:dev Mar 24, 2020
@OnFreund
Copy link
Copy Markdown
Contributor Author

Thanks @balloob. Where would be a good place to open a ticket for the removal of an optional value, so that we're aware of the current limitation and hopefully find a solution in the future? Is that in the frontend repo or arch repo (since it's the backend that's currently controlling it)?

@balloob
Copy link
Copy Markdown
Member

balloob commented Mar 24, 2020

https://github.com/home-assistant/frontend. But it's difficult, because in most cases you do want the default :( So we would need a way to indicate allow_empty=True

@lock lock Bot locked and limited conversation to collaborators Mar 27, 2020
@OnFreund OnFreund deleted the monoprice_options_flow branch April 25, 2020 15:48
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