Commit Graph
42 Commits
Author SHA1 Message Date
6bb4e7d62c Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <[email protected]>
Co-authored-by: Marc Mueller <[email protected]>
Co-authored-by: J. Nick Koston <[email protected]>
2024-03-26 00:02:16 +01:00
Marc MuellerandGitHub 32f3f46542 Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Jan BouwhuisandGitHub 94ccd59123 Fix generic camera error when template renders to an invalid URL (#109737) 2024-02-05 20:19:38 +01:00
Marc MuellerandGitHub 7a89e58873 Use builtin TimeoutError [e-i] (#109679) 2024-02-05 12:00:37 +01:00
Jan BouwhuisandGitHub 4b8d8baa69 Remove deprecated YAML import from generic camera (#107992) 2024-01-14 09:36:00 +01:00
Daniel SchallandGitHub 8778763a3e Synchronize and cache Generic Camera still image fetching (#105821) 2023-12-27 21:19:25 +01:00
J. Nick KostonandGitHub 608f4f7c52 Bump aiohttp to 3.9.1 (#104176) 2023-11-29 16:13:54 +01:00
Marc MuellerandGitHub 02567d9bf6 Revert aiohttp to 3.8.5 for Python 3.11 (#101932) 2023-10-13 14:12:42 +02:00
Marc MuellerandGitHub 3155e62510 Update aiohttp to 3.9.0b0 (#101627) 2023-10-08 13:21:46 +02:00
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 <[email protected]>

* Change usage of async_timeout

* Change import formatting in generic/test_camera

* Simplify Nest camera property initialization

---------

Co-authored-by: Allen Porter <[email protected]>
2023-08-26 10:39:40 -07:00
epenetandGitHub b68f502769 Add type hints to integration tests (part 7) (#87980) 2023-02-13 09:53:09 +01:00
epenetandGitHub 7a4d15a657 Add type hints to integration tests (f-g) (#87700) 2023-02-08 13:33:52 +01:00
Franck NijhofandGitHub 5e81d28116 Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
6040c30b45 Add visual image preview during generic camera config flow (#71269)
* Add visual preview during setup of generic camera

* Code review: standardize preview  url

* Fix slug test

* Refactor to use HomeAssistantView

* Code review: simplify

* Update manifest

* Don't illegally access protected member

* Increase test coverage

* Prevent browser caching of preview images.

* Code review:move incrementor to ?t=X + simplify

* Discard old flow preview data

* Increase test coverage

* Code review: rename variables for clarity

* Add timeout for image previews

* Fix preview timeout tests

* Simplify: store cam image preview in config_flow

* Call step method to transition between flow steps

* Only store user_input in flow, not CameraObject

* Fix problem where test wouldn't run in isolation.

* Simplify test

* Don't move directly to another step's form

* Remove unused constant

* Simplify test

Co-authored-by: Dave T <[email protected]>
2022-10-06 22:24:19 +02:00
e64336cb91 Allow configuring username and password in generic camera config flow (#73804)
* Add ability to use user & pw not in stream url

* Increase test coverage to 100%

* Increase test coverage

* Verify that stream source includes user:pass

* Code review: refactor test to use MockConfigEntry

* Code review: Improve test docstring

* Edit comment; retrigger CI.

Co-authored-by: Dave T <[email protected]>
2022-06-29 10:54:04 +02:00
uvjustinandGitHub b1f2e5f897 Use create_stream in generic camera config flow (#73237)
* Use create_stream in generic camera config flow
2022-06-11 15:38:43 +10:00
Dave TandGitHub 6fd041b290 Don't test config on yaml import for generic camera (#69714) 2022-04-08 22:59:54 -07:00
c1a2be72fc Generic IP Camera configflow 2 (#52360)
Co-authored-by: J. Nick Koston <[email protected]>
2022-03-28 09:08:00 -10:00
Dave TandGitHub 490c921763 Don't access hass.data directly in generic camera test. (#68316) 2022-03-17 14:29:21 -10:00
Dave TandGitHub 5ebc02cef6 Fix generic camera typo in attr_frame_interval (#65390) 2022-02-08 14:47:36 -08:00
Dave TandGitHub 89895c6c04 Improve tests for generic camera (#63197)
* Improve tests for generic camera

* Fix black error

* Code review: Move common code to fixtures

* Remove unnecessary patches from tests.

* Address review comments

* Code review: swap more patches for respx

* Code review: use _attr for frame interval.
2022-01-02 13:26:44 -08:00
uvjustinandGitHub 08a3140e6c Allow generic camera conf without still_image_url (#62611)
* Allow generic config with no CONF_STILL_IMAGE_URL
* Use Stream.async_get_image when no CONF_STILL_IMAGE_URL
* Remove GenericCamera.camera_image
2021-12-26 15:53:14 +08:00
J. Nick KostonandGitHub 10d6247fee Bump to aiohttp 3.8.0 (#58974) 2021-11-04 10:07:50 -05:00
Paulus SchoutsenandGitHub 31153ac155 Move fixtures part 1 (#58902) 2021-11-01 20:47:05 -07:00
Ville SkyttäandGitHub b52c5c82b1 Use http.HTTPStatus in components/[gh]* (#58246) 2021-10-23 20:34:53 +02:00
Erik MontnemeryandGitHub e631671832 Use respx.mock in generic camera tests (#55521) 2021-09-01 20:45:29 +02:00
uvjustinandGitHub e8d7d96231 Roll back #47852 (shield httpx in generic) (#50562) 2021-05-13 20:32:06 -07:00
uvjustinandGitHub 379843eb54 Shield async httpx call in generic (#47852)
* Shield async httpx call

* Don't set last_url/last_image on cancellation

* Add test
2021-03-31 12:46:10 +08:00
uvjustinandGitHub 39da0dc409 Add rtsp transport options to generic camera (#46623)
* Add rtsp transport options to generic camera
2021-02-21 02:11:50 +08:00
uvjustinandGitHub 9917bb76fb Use httpx in generic camera (#46576)
* Use httpx in generic camera

* Remove commented out code
2021-02-15 16:37:53 +01:00
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 <[email protected]>

* 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 <[email protected]>
2021-02-08 19:53:28 -08:00
Franck NijhofandGitHub 65cf2fcb6f Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Paulus Schoutsen d9f3bdea53 Black 2020-08-28 15:33:08 +00:00
J. Nick KostonandGitHub 400741006b Add the ability to reload generic platforms from yaml (#39289) 2020-08-28 16:44:51 +02:00
e1060f154e Make generic camera stream_source a template (#36123)
Co-authored-by: Martin Hjelmare <[email protected]>
2020-06-22 16:11:18 -07:00
J. Nick KostonandGitHub 141c4c2f33 Fix various flapping tests that are missing block_till_done (#36346)
* Add missing async_block_till_done to various tests

* Add missing async_block_till_done to various tests
2020-06-01 10:11:09 -05:00
springstanandGitHub 9a40d5b7ed Use HTTP_NOT_FOUND constant (#33835) 2020-04-09 00:57:47 +02:00
springstanandGitHub fb8f8133a0 Use HTTP_INTERNAL_SERVER_ERROR constant (#33832) 2020-04-08 23:20:03 +02:00
Franck NijhofandAndrew Sayre b9fcb87d2c Migrate generic tests from coroutine to async/await (#30388) 2020-01-02 14:23:16 -06:00
Bas NijholtandFranck Nijhof d58e6e924a Sort imports according to PEP8 for components starting with "G" (#29767) 2019-12-09 14:17:36 +01:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Penny WoodandPaulus Schoutsen f195ecca4b Consolidate all platforms that have tests (#22109)
* Moved climate components with tests into platform dirs.

* Updated tests from climate component.

* Moved binary_sensor components with tests into platform dirs.

* Updated tests from binary_sensor component.

* Moved calendar components with tests into platform dirs.

* Updated tests from calendar component.

* Moved camera components with tests into platform dirs.

* Updated tests from camera component.

* Moved cover components with tests into platform dirs.

* Updated tests from cover component.

* Moved device_tracker components with tests into platform dirs.

* Updated tests from device_tracker component.

* Moved fan components with tests into platform dirs.

* Updated tests from fan component.

* Moved geo_location components with tests into platform dirs.

* Updated tests from geo_location component.

* Moved image_processing components with tests into platform dirs.

* Updated tests from image_processing component.

* Moved light components with tests into platform dirs.

* Updated tests from light component.

* Moved lock components with tests into platform dirs.

* Moved media_player components with tests into platform dirs.

* Updated tests from media_player component.

* Moved scene components with tests into platform dirs.

* Moved sensor components with tests into platform dirs.

* Updated tests from sensor component.

* Moved switch components with tests into platform dirs.

* Updated tests from sensor component.

* Moved vacuum components with tests into platform dirs.

* Updated tests from vacuum component.

* Moved weather components with tests into platform dirs.

* Fixed __init__.py files

* Fixes for stuff moved as part of this branch.

* Fix stuff needed to merge with balloob's branch.

* Formatting issues.

* Missing __init__.py files.

* Fix-ups

* Fixup

* Regenerated requirements.

* Linting errors fixed.

* Fixed more broken tests.

* Missing init files.

* Fix broken tests.

* More broken tests

* There seems to be a thread race condition.
I suspect the logger stuff is running in another thread, which means waiting until the aio loop is done is missing the log messages.
Used sleep instead because that allows the logger thread to run. I think the api_streams sensor might not be thread safe.

* Disabled tests, will remove sensor in #22147

* Updated coverage and codeowners.
2019-03-18 23:07:39 -07:00