Commit Graph

53 Commits (3abf7ea18a67852c9d4ce629f266100de2e1d27b)

Author SHA1 Message Date
epenet 7a4d15a657
Add type hints to integration tests (f-g) (#87700) 2023-02-08 13:33:52 +01:00
epenet 59ca7780fa
Add typing to tests with single hass argument (#87631) 2023-02-07 15:01:16 +01:00
Franck Nijhof ca1a12898c
Enable Ruff D212 (#87347) 2023-02-03 23:08:48 +01:00
Franck Nijhof 5e81d28116
Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
Franck Nijhof ef800335fb
Enable Ruff PT022 (#86792)
* Enable Ruff PT022

* Adjust found cases
2023-01-27 13:57:06 +01:00
Dave T e5716efa9c
Add visual image preview during generic camera options flow (#80392)
Co-authored-by: Dave T <davet2001@users.noreply.github.com>
2022-10-25 10:03:19 +02:00
Dave T 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 <davet2001@users.noreply.github.com>
2022-10-06 22:24:19 +02:00
Dave T 7075032bf7
Fix diagnostics export for generic camera (#75665)
Fix url redaction and add tests

Co-authored-by: Dave T <davet2001@users.noreply.github.com>
2022-07-24 10:21:01 +02:00
Franck Nijhof 7cd68381f1
Search/replace RESULT_TYPE_* by FlowResultType enum (#74642) 2022-07-07 19:57:36 +03:00
Dave T 737a1fd9fa
Dont substitute user/pass for relative stream urls on generic camera (#74201)
Co-authored-by: Dave T <davet2001@users.noreply.github.com>
2022-07-03 13:26:00 -07:00
Dave T 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 <davet2001@users.noreply.github.com>
2022-06-29 10:54:04 +02:00
Dave T cdd5a5f68b
Generic ipcam configflow2 followup (#73511)
* Address code review comments

* Add type hints

* Remvoe unused strings

* Remove persistent notification setup

* Patch async_configre

* Fix pylint warning

* Address review comments

* Clean types

* Code review: defer local var assignment

Co-authored-by: Dave T <davet2001@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-06-17 07:07:21 +02:00
uvjustin 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 T ce477e65ce
Render template during stream_url test for generic camera (#69716) 2022-05-25 09:02:48 +02:00
uvjustin 221b77297e
Declare exports from stream explicitly (#71898) 2022-05-15 17:58:57 +02:00
uvjustin 617b0d04dc
Decouple stream options from PyAV options (#71247)
Co-authored-by: Allen Porter <allen.porter@gmail.com>
2022-05-14 23:31:18 -07:00
Dave T 807df530bc
Add diagnostics file export to generic camera (#71492) 2022-05-13 10:27:08 -07:00
uvjustin 7e49ae6410
Add use_wallclock_as_timestamps option to generic (#71245)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-05-12 16:43:24 -07:00
Dave T 26c6328b1f
Generic camera handle template adjacent to portnumber (#71031) 2022-05-01 16:13:21 -07:00
Dave T 2c028d203f
Remove invalid unique id from generic camera (#70568)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-04-27 17:08:18 -05:00
Dave T d69a7e7be9
Hide credentials from generated titles in generic camera (#70204) 2022-04-18 07:57:52 -07:00
Dave T 32f9aefb40
Auto set content type for stream-only in generic camera (#70200) 2022-04-17 22:28:25 -07:00
Dave T 6d17f4ffff
Support webp still image format in generic camera (#69718) 2022-04-08 23:06:34 -07:00
Dave T 6fd041b290
Don't test config on yaml import for generic camera (#69714) 2022-04-08 22:59:54 -07:00
Dave T be8e28503c
Generic fix stream thumbnail (#69378) 2022-04-07 15:01:29 -07:00
Dave T c3354dcaae
Add image test cases to generic (#69040) 2022-04-02 10:54:19 +02:00
Dave T 7a5235dc0c
Generic camera: Allow gif image type in still image checker (#68933) 2022-03-30 21:02:43 -10:00
Dave T 3244980a35
Generic camera: Allow svg detect to accept leading whitespace (#68932) 2022-03-31 00:45:55 +02:00
Dave T c1a2be72fc
Generic IP Camera configflow 2 (#52360)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-03-28 09:08:00 -10:00
Dave T 490c921763
Don't access hass.data directly in generic camera test. (#68316) 2022-03-17 14:29:21 -10:00
Dave T 5ebc02cef6
Fix generic camera typo in attr_frame_interval (#65390) 2022-02-08 14:47:36 -08:00
Dave T 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
uvjustin 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 Koston 10d6247fee
Bump to aiohttp 3.8.0 (#58974) 2021-11-04 10:07:50 -05:00
Paulus Schoutsen 31153ac155
Move fixtures part 1 (#58902) 2021-11-01 20:47:05 -07:00
Ville Skyttä b52c5c82b1
Use http.HTTPStatus in components/[gh]* (#58246) 2021-10-23 20:34:53 +02:00
Erik Montnemery e631671832
Use respx.mock in generic camera tests (#55521) 2021-09-01 20:45:29 +02:00
uvjustin e8d7d96231
Roll back #47852 (shield httpx in generic) (#50562) 2021-05-13 20:32:06 -07:00
uvjustin 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
uvjustin 39da0dc409
Add rtsp transport options to generic camera (#46623)
* Add rtsp transport options to generic camera
2021-02-21 02:11:50 +08:00
uvjustin 9917bb76fb
Use httpx in generic camera (#46576)
* Use httpx in generic camera

* Remove commented out code
2021-02-15 16:37:53 +01: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
Franck Nijhof 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 Koston 400741006b
Add the ability to reload generic platforms from yaml (#39289) 2020-08-28 16:44:51 +02:00
zvldz e1060f154e
Make generic camera stream_source a template (#36123)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-06-22 16:11:18 -07:00
J. Nick Koston 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
springstan 9a40d5b7ed
Use HTTP_NOT_FOUND constant (#33835) 2020-04-09 00:57:47 +02:00
springstan fb8f8133a0
Use HTTP_INTERNAL_SERVER_ERROR constant (#33832) 2020-04-08 23:20:03 +02:00
Franck Nijhof b9fcb87d2c Migrate generic tests from coroutine to async/await (#30388) 2020-01-02 14:23:16 -06:00