Commit Graph

114 Commits

Author SHA1 Message Date
Robert Resch
348e1df949 Add strict connection (#112387)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-04-12 14:47:46 +02:00
Sid
0d66d298ec Enable Ruff RET504 (#114528)
* Enable Ruff RET504

* fix test

* Use noqa instead of cast

* fix sonos RET504

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-04-06 11:07:37 +02:00
Joost Lekkerkerker
6bb4e7d62c Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
J. Nick Koston
ac80d38871 Fix flakey stream hls test (#114046) 2024-03-23 11:11:42 +01:00
J. Nick Koston
c5eacf55c2 Fix flapping stream hls test (#113858) 2024-03-20 08:27:05 +01:00
J. Nick Koston
2582172ad1 Create tasks eagerly with core create_task (#113781) 2024-03-19 08:41:39 +01:00
Sid
82a60fe8ad Enable Ruff RSE (#113695) 2024-03-18 00:40:38 +01:00
Sid
d5fd005db8 Add ruff rule PIE808 (#113621) 2024-03-17 09:56:26 +01:00
Sid
ccd2e989c3 Enable ruff RUF005 and fix occurrences (#113589) 2024-03-16 07:37:20 -10:00
Joost Lekkerkerker
77917506bb Improve lists in integrations [R-S] (#113233)
* Improve lists in integrations [R-S]

* Fix

* Fix
2024-03-13 21:55:00 +01:00
Marc Mueller
32f3f46542 Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Marc Mueller
7d6251ca08 Add empty line after module docstring [tests q-s] (#112711) 2024-03-08 14:47:22 +01:00
uvjustin
d40a08958d Use dataclasses instead of attrs in stream (#101148) 2023-09-30 09:46:30 +02:00
Raman Gupta
067b94899f Move EVENT_LOGGING_CHANGED to constants (#100974)
* Move EVENT_LOGGING_CHANGED to constants

* fix test

* remove logger as dependency for bluetooth and fix test
2023-09-27 01:06:14 -04:00
uvjustin
5021c69886 Update Stream logging on EVENT_LOGGING_CHANGED (#99256) 2023-09-12 19:38:11 +02:00
uvjustin
407aa31adc Generate Stream snapshots using next keyframe (#96991)
* Add wait_for_next_keyframe option to stream images
Add STREAM_SNAPSHOT to CameraEntityFeature
Use wait_for_next_keyframe option for snapshots using stream

* Update stream test comments

* Add generic camera snapshot test

* Get stream still images directly in camera
Remove getting stream images from generic, nest, and ONVIF
Refactor camera preferences
Add use_stream_for_stills setting to camera
Update tests

* Only attempt to get stream image if integration supports stream

* Use property instead of entity registry setting

* Split out getting stream prerequisites from stream_source in nest

* Use cached_property for rtsp live stream trait

* Make rtsp live stream trait NestCamera attribute

* Update homeassistant/components/nest/camera.py

Co-authored-by: Allen Porter <allen.porter@gmail.com>

* Change usage of async_timeout

* Change import formatting in generic/test_camera

* Simplify Nest camera property initialization

---------

Co-authored-by: Allen Porter <allen.porter@gmail.com>
2023-08-26 10:39:40 -07:00
Marc Mueller
089f76099d Fix stream test aiohttp DeprecationWarning (#98962) 2023-08-24 19:50:25 +02:00
Ville Skyttä
9da192c752 Avoid use of datetime.utc* methods deprecated in Python 3.12 (#93684)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2023-08-24 16:38:22 +02:00
uvjustin
3e58e1987c Avoid infinite loop on corrupt stream recording (#96881)
* Avoid infinite loop on corrupt stream recording

* Update tests
2023-07-19 09:06:04 +02:00
epenet
e277bbb513 Use tmp_path in tests (#91203)
* Use tmp_path in tests

* Use joinpath

* Prefer / operator

* Cleanup
2023-04-12 08:19:01 +02:00
epenet
dab8557951 Add type hints to integration tests (part 21) (#88233) 2023-02-16 11:15:26 +01:00
Franck Nijhof
ed79265843 Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
epenet
ba85fdcd61 Add type hints to integration tests (q-s) (#87706) 2023-02-08 08:12:54 -08:00
Franck Nijhof
ca1a12898c Enable Ruff D212 (#87347) 2023-02-03 23:08:48 +01:00
Franck Nijhof
62dcbe5258 Enable Ruff PT001 (#86730) 2023-01-26 18:05:05 +01:00
uvjustin
d0153f5031 Detect timestamp discontinuity in stream (#86430)
fixes undefined
2023-01-23 10:09:46 +01:00
uvjustin
6bab63fb0a Redact more credentials in stream URL query params (#82089)
Co-authored-by: Allen Porter <allen.porter@gmail.com>
2022-11-15 12:42:40 +08:00
uvjustin
ee910bd0e4 Refactor camera stream settings (#81663) 2022-11-13 01:22:59 +08:00
uvjustin
eb141a532c Bump ha-av to v10.0.0 (#80514) 2022-10-20 00:06:49 +03:00
uvjustin
d38d21ab3a Fix stream recorder with orientation transforms (#80370)
Find moov instead of using fixed location
2022-10-17 21:12:45 -04:00
epenet
e9f55f4e54 Apply hass-relative-import to tests (s-z) (#78733) 2022-09-19 09:51:31 +02:00
uvjustin
852b0caf5b Add orientation transforms to stream (#77439) 2022-09-06 13:31:36 +08:00
uvjustin
75892385bb Fix playback of hls cameras in stream (#75166) 2022-07-14 12:24:24 -07:00
Franck Nijhof
af2feb3d40 Update pyupgrade to v2.37.1 (#74989) 2022-07-11 16:54:01 +02:00
Franck Nijhof
68ccb96089 Refactor CI (#74014) 2022-07-07 18:53:24 +02:00
uvjustin
f45afe7379 Use bitstream filter to allow ADTS AAC audio in stream (#74151) 2022-06-29 10:15:22 +02:00
uvjustin
7a3f632c1d Make stream recorder work concurrently (#73478) 2022-06-18 05:13:07 +10:00
uvjustin
01a4a83bab Improve stream playback on high latency cameras (#72547)
* Disable LL-HLS for HLS sources
* Add extra wait for Nest cameras
2022-06-17 01:48:52 +10:00
uvjustin
73f2bca377 Make Stream.stop() async (#73107)
* Make Stream.start() async
* Stop streams concurrently on shutdown
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-06-08 00:10:53 +08:00
uvjustin
c2612d1ade Remove cache control headers from stream (#71996) 2022-05-23 13:56:26 +08:00
Allen Porter
41a032e3e3 Add diagnostics to stream's Stream objects (#68020)
* Add diagnostics to stream's Stream objects

Add diagnostics key/value pair to the Stream object. Diagnostics support
in camera integration will be added in a follow up and will access the
diagnostics on the Stream object, similar to the examples in the unit
test.

* Rename to audio/video codec

* Fix test codec names

* Update tests/components/stream/test_worker.py

Co-authored-by: uvjustin <46082645+uvjustin@users.noreply.github.com>

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: uvjustin <46082645+uvjustin@users.noreply.github.com>
2022-03-18 07:40:09 -07:00
uvjustin
4efada7db0 Allow stream log level to change at runtime (#66153) 2022-02-21 17:58:15 +01:00
Allen Porter
0a128d006f Improve stream robustness by always retrying worker (#66417)
Improve stream robustness by always retrying in the worker on failure, rather than only when
keepalive is enabled.

This will make cloud cameras like nest more robust, since they have a tendency to be flaky. This
is also needed to improve client side retry behavior because when the client attempts to retry,
the stream token is already revoked because the worker stopped.

The worker will still idle timeout if no streams are present, so it won't go on forever if no
frontend is viewing the stream.
2022-02-12 20:59:11 -08:00
Allen Porter
e74fe0e390 Enable Low Latency HLS (LL-HLS) by default to lower stream latency (#64643) 2022-01-23 15:38:29 +01:00
Simone Chemelli
969930b9c9 Remove debug print (#63460) 2022-01-05 15:34:33 +01:00
Allen Porter
23384ee1e8 Update stream errors with additional error information (#62900) 2021-12-29 18:57:14 +01:00
uvjustin
9dbba6b7f2 Use lock in Camera.create_stream (#62757)
Rename create_stream to async_create_stream in Camera
Rename get_image to async_get_image in Stream
Rename get_image to async_get_image in KeyFrameConverter
2021-12-25 04:14:43 +08:00
uvjustin
6e13605cad Add get_image method to Stream (#61918)
* Add get_image method to Stream

* Add KeyFrameConverter class
2021-12-23 00:24:53 +08:00
Allen Porter
6ae7b928ea Add a camera specific logger to help diagnose stream errors (#61647)
* Add a camera specific logger to help diagnose stream errors

Add a camera specific logger to help users associate stream errors with a particular camera.
Issue #54659

* Apply code review feedback

* Update package name based on manual testing
2021-12-19 19:42:37 -08:00
Allen Porter
647febd7d8 Mark camera unavailable when keepalive stream fails (#62294)
* Mark camera unavailable when keepalive stream fails

Add a listener in stream that notifies camera when the stream state has changed, and
use that to inform the camera `available` property. Update the property to be set
only from the main loop where it is read to reduce thread safety races.

Issue #54659

* Fix pylint import related errors

* Address lint naming errors

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-12-19 09:09:59 -08:00