-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
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
Encode generic camera settings in preview URL query #127383
Conversation
Hey there @davet2001, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
encoded_user_input = json.dumps(self.user_input, separators=(",", ":")) | ||
preview_url = f"/api/generic/preview_flow_image/{self.flow_id}?d={encoded_user_input}&t={datetime.now().isoformat()}" |
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.
Another option would be to keep the user_input internally (eg. self.preview_cam
), and then use
flow = self.hass.config_entries.flow._progress.get( # noqa: SLF001
flow_id
) or self.hass.config_entries.options._progress.get(flow_id) # noqa: SLF001
if not flow:
_LOGGER.warning("Unknown flow %s while getting image preview", flow_id)
raise web.HTTPNotFound
user_input = flow.preview_cam
@emontnemery now that #127405 is merged, I assume this is no longer needed and can be closed. |
Proposed change
Encode generic camera settings in preview URL query instead of storing the setting in flow context
Needs #127382 for tests to pass
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: