-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add stream preview to options flow in generic camera #133927
Add stream preview to options flow in generic camera #133927
Conversation
a6c0bb5
to
9b0fa57
Compare
user_input[CONF_CONTENT_TYPE] = still_format | ||
still_url = user_input.get(CONF_STILL_IMAGE_URL) | ||
if still_url is None: | ||
# If user didn't specify a still image URL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this just be handled inside of async_test_still
? This seems like extra detail spilling out.
(I realize this is not changing in this PR, but it shows up as a diff)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a copy/paste of what is in the existing config flow, so designed to be as similar as possible.
I would like to rationalise these into one combined function for config_flow/options_flow in future.
Yes, the image format assignment could probably go into async_test_still
, but I would prefer to do that as a separate PR rather than make this one bigger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow up PR to address this point: #134330
), | ||
**user_input, | ||
CONF_CONTENT_TYPE: still_format | ||
or self.config_entry.options.get(CONF_CONTENT_TYPE), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also seems like it could be handled there given there is already code doing stuff like this and determining the defaults
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree. I suggest it is put in a follow up PR though.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detail. Looks good to me though we still have a pending question about GenericOptionsFlowHandler
cast.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. There is a test coverage warning so perhaps you can double check the config flow has 100% test coverage?
a8c4278
to
24b1d88
Compare
24b1d88
to
418b9d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to delete the dead code than add this given this can't happen yet today. Or leave it since the gap was added in my PR (sorry about that)
Ok. done in 32ca8e5 |
* Add stream preview to options flow * Increase test coverage * Code review: use correct flow handler type in cast * Restore test coverage to 100% * Remove error and test that can't be triggered yet
Proposed change
#122563 added a preview of the video stream while setting up an IP camera via a config flow.
This PR adds the same preview to the options flow
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: