Commit Graph

478 Commits (2df13d01187a4fac2f9038facc180eb2c2543712)

Author SHA1 Message Date
Allen Porter dafea00f41
Rename `stream_type` to `frontend_stream_type` (#57923)
Camera devices may support multiple stream sources so we want to clarify that
this is meant to decide which stream source is used in the frontend only.

Will set stream_type temporarily to allow rollout without breaking nightly,
and this will be removed after frontend is updated.
2021-10-17 20:16:29 -07:00
Marc Mueller 2b72b7b7b9
Use assignment expressions 09 (#57790) 2021-10-17 20:19:56 +02:00
Allen Porter 7d4dd94da8
Add WebSocket API for intiting a WebRTC stream (#57034)
* Add WebSocket API for intiting a WebRTC stream

See https://github.com/home-assistant/architecture/discussions/640

* Increase test coverage for webrtc camera stream

* Apply suggestions from code review

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

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-10-07 22:13:14 -07:00
Marc Mueller 565a9fea6b
Import Callable from collections.abc (2) (#56776) 2021-09-29 14:06:51 +02:00
Franck Nijhof 655dc890e4
Upgrade PyTurboJPEG to 1.6.1 (#56571) 2021-09-23 15:34:34 +02:00
Marc Mueller 48bada5a18
Update pylint to 2.11.1 (#56364) 2021-09-18 13:52:59 +02:00
J. Nick Koston fbcf21412d
Only warn once per entity when the async_camera_image signature needs to be updated (#55238) 2021-08-26 09:36:25 -07:00
J. Nick Koston dc851b9dd5
Ensure camera scaling always produces an image of at least the requested width and height (#55033) 2021-08-24 10:44:12 +02:00
Franck Nijhof d8eedaf9fd
Upgrade PyTurboJPEG to 1.5.2 (#54992) 2021-08-21 16:58:25 -05:00
Marc Mueller 69e413ac1e
Update pylint to 2.10.1 (#54963)
* Update pylint to 2.10.0

* useless-suppression

* Consider-using-tuple

* Apply suggestions from code review

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

* Use dict.items()

* Add pylint disable

* Use pylint 2.10.1

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-08-21 10:41:23 +02:00
J. Nick Koston 1e14b3a0ac
Ensure camera handles non-jpeg image sources correctly (#54474) 2021-08-11 08:12:46 -07:00
J. Nick Koston e99576c094
Pass width and height when requesting camera snapshot (#53835) 2021-08-10 19:33:06 -05:00
jan iversen 19245a5b63
Add CameraEntityDescription to camera integration (#53636) 2021-07-28 21:09:45 +02:00
GitHub Action 0c5ce9cac2 [ci skip] Translation update 2021-07-07 00:11:57 +00:00
GitHub Action 7615af35d8 [ci skip] Translation update 2021-06-07 00:18:16 +00:00
tkdrob 028a07d86f
Wrap up selectors (#50794)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-05-25 14:45:17 +02:00
Paulus Schoutsen 6a7968593d
Make camera source check faster (#51035) 2021-05-24 17:27:13 +01:00
Dermot Duffy 2e1037005c
Allow camera stream to fail safely (#50728) 2021-05-17 20:34:25 -07:00
Franck Nijhof eccefd154a
Extend targets for entity component services (#50760) 2021-05-17 14:06:50 +02:00
Ruslan Sayfutdinov 8e2b3aab44
Enable strict type checks for camera platform (#50395) 2021-05-10 15:12:15 +02:00
Ruslan Sayfutdinov 9b058551f7
Enable type checks for camera platform (#50179) 2021-05-09 18:04:57 +02:00
Tobias Sauerwein 2b79c91813
Clean up camera service schema (#49151) 2021-04-13 13:07:05 +02:00
Erik Montnemery 346a724ac3
Mark base components' state_attribute @final, rename others to extra_state_attributes (#48161)
* Mark base state_attributes @final, rename others to extra_state_attributes

* Fix calendar, update tests
2021-03-21 10:38:24 +01:00
Franck Nijhof ea4bbd771f
Add service names to previously enriched services (#46929)
Co-authored-by: Tobias Sauerwein <cgtobi@users.noreply.github.com>
2021-02-23 14:10:13 +01:00
Allen Porter 4aa4f7e285
Rollback stream StreamOutput refactoring in PR#46610 (#46684)
* Rollback PR#46610

* Update stream tests post-merge
2021-02-20 06:49:39 -08:00
Franck Nijhof dec2eb36fd
Add selectors to Camera service definitions (#46630) 2021-02-18 12:24:04 +01:00
Allen Porter 4236f6e5d4
Fix stream keepalive on startup (#46640)
This was accidentally dropped in a previous PR that refactored the interaction
between stream and camera. This is difficult to test from the existing
preload stream tests, so leaving untested for now.
2021-02-16 20:46:44 -08:00
Allen Porter 08201d146b
Separate HLS logic out of core StreamOutput to prepare for discontinuity (#46610)
Separate the HLS stream view logic out of StreamOutput since the hls
stream view is about to get more complex to track discontinuities. This
makes the idle timeout, shutdown, and coupling between hls and record
more explicit.
2021-02-16 06:59:43 -08:00
Allen Porter b33753f334
Move camera timeouts to constants (#46262)
Addresses feedback from pr #45431.  Also removes an redundant `create_stream` timeout.
2021-02-08 21:21:14 -08:00
Allen Porter 2bcf87b980
Change the API boundary between camera and stream with initial improvement for nest expiring stream urls (#45431)
* Change the API boundary between stream and camera

Shift more of the stream lifecycle management to the camera.  The motivation is to support stream urls that expire
giving the camera the ability to change the stream once it is created.

* Document stream lifecycle and simplify stream/camera interaction

* Reorder create_stream function to reduce diffs

* Increase test coverage for camera_sdm.py

* Fix ffmpeg typo.

* Add a stream identifier for each stream, managed by camera

* Remove stream record service

* Update homeassistant/components/stream/__init__.py

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

* Unroll changes to Stream interface back into camera component

* Fix preload stream to actually start the background worker

* Reduce unncessary diffs for readability

* Remove redundant camera stream start code

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-02-08 19:53:28 -08:00
Ville Skyttä 317ed418dd
Use singleton enum for "not set" sentinels (#41990)
* Use singleton enum for "not set" sentinel

https://www.python.org/dev/peps/pep-0484/#support-for-singleton-types-in-unions

* Remove unused variable
2020-12-19 12:46:27 +01:00
HomeAssistant Azure b71e28dfac [ci skip] Translation update 2020-11-04 00:13:14 +00:00
HomeAssistant Azure 6e53aa1155 [ci skip] Translation update 2020-10-23 00:03:04 +00:00
HomeAssistant Azure 6ae12c3faf [ci skip] Translation update 2020-10-10 00:05:05 +00:00
Jason Hunter 8bc62f3678
Fix camera play stream (#40641)
Co-authored-by: Justin Wong <46082645+uvjustin@users.noreply.github.com>
2020-09-28 14:24:30 +02:00
springstan c2d20c548f
Use content type multipart constant (#40314) 2020-09-23 11:29:56 +02:00
Jason Hunter 1a78d96014
allow creating directories from camera snapshot, stream record, and tensorflow file out (#39728) 2020-09-06 18:54:24 -04:00
Ville Skyttä b4bac0f7a0
Exception chaining and wrapping improvements (#39320)
* Remove unnecessary exception re-wraps

* Preserve exception chains on re-raise

We slap "from cause" to almost all possible cases here. In some cases it
could conceivably be better to do "from None" if we really want to hide
the cause. However those should be in the minority, and "from cause"
should be an improvement over the corresponding raise without a "from"
in all cases anyway.

The only case where we raise from None here is in plex, where the
exception for an original invalid SSL cert is not the root cause for
failure to validate a newly fetched one.

Follow local convention on exception variable names if there is a
consistent one, otherwise `err` to match with majority of codebase.

* Fix mistaken re-wrap in homematicip_cloud/hap.py

Missed the difference between HmipConnectionError and
HmipcConnectionError.

* Do not hide original error on plex new cert validation error

Original is not the cause for the new one, but showing old in the
traceback is useful nevertheless.
2020-08-28 13:50:32 +02:00
Cooper Dale 0b0e323632
Fix missing .name at entity_id in service example (#38515)
for propper filename
2020-08-03 18:22:52 +02:00
Ville Skyttä ac0dbb17af
Attrs cleanups (#37849) 2020-07-14 10:30:30 -07:00
Franck Nijhof 53545c984b
Log lines do not end with a full stop (#37527) 2020-07-05 23:04:19 +02:00
Paulus Schoutsen 276f3afb00
Do async_setup_platform in background (#36244)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-31 22:18:30 -07:00
Ville Skyttä f8416484f8
More data entry flow and HTTP related type hints (#34430) 2020-05-26 09:28:22 -05:00
J. Nick Koston 3dfeec5033
Implement async_get_stream_source in the camera integration (#35704) 2020-05-25 15:41:50 -07:00
Franck Nijhof e3e3a113e9
async_get_url -> get_url (#35382) 2020-05-08 21:53:28 +02:00
Franck Nijhof 2223592486
Add get_url helper, deprecate base_url (#35224) 2020-05-08 02:29:47 +02:00
HomeAssistant Azure 7faba60e83 [ci skip] Translation update 2020-04-29 00:03:31 +00:00
HomeAssistant Azure aa2bfbb541 [ci skip] Translation update 2020-04-27 00:02:20 +00:00
HomeAssistant Azure 46920e9be6 [ci skip] Translation update 2020-04-22 00:03:20 +00:00
Joakim Sørensen 730a257f3c
Rename translations dir for integrations (#34494) 2020-04-21 16:11:05 -07:00