-
-
Notifications
You must be signed in to change notification settings - Fork 30.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
Refactor camera stream settings #81663
Conversation
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Hey there @davet2001, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Hey there @hunterjm, @allenporter, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
f45bd5e
to
345f847
Compare
345f847
to
191bda7
Compare
@@ -498,12 +506,13 @@ def _generate_image(self, width: int | None, height: int | None) -> None: | |||
if frames: | |||
frame = frames[0] | |||
if width and height: | |||
if self._stream_settings.orientation >= 5: | |||
if self._dynamic_stream_settings.orientation >= 5: |
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 comparison is easier to see as an int. It happens that orientations 5, 6, 7, and 8 are rotated once so have flipped dimensions.
Proposed change
The
preload_stream
(keepalive) andorientation
settings are used by stream but are managed/updated by camera. This requires syncing the options from camera to stream when they are updated.This PR puts these two options into a
DynamicStreamSettings
class which is passed fromcamera
intostream
, avoiding keeping two copies of the options which may get out of sync.Type of change
Additional information
Checklist
black --fast 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
..coveragerc
.To help with the load of incoming pull requests: