Commit Graph

73 Commits (5c018f6ffceefd02f0f42779c2348e802a7e0541)

Author SHA1 Message Date
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
epenet 0b01326f9f
Use is in ConfigEntryState enum comparison in tests (A-M) (#114925) 2024-04-05 17:16:55 +02:00
Joost Lekkerkerker b9281327c4
Use FlowResultType enum in config flow tests A-M (#114681) 2024-04-03 09:21:17 +02:00
Joost Lekkerkerker 906d3198e3
Use is in enum comparison in config flow tests F-J (#114670)
* Use right enum expression F-J

* Fix
2024-04-02 23:01: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
Dave T a6d98c1857
Improve user error messages for generic camera (#112814)
* Generic camera: Insufficient error message when configuration fails
Fixes #112279

* Add tests

* Fix typo in string

* Add new error strings to options flow.

* Group and improve error strings following PR review
2024-03-21 21:54:45 +00:00
Marc Mueller 32f3f46542
Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Jan Bouwhuis 94ccd59123
Fix generic camera error when template renders to an invalid URL (#109737) 2024-02-05 20:19:38 +01:00
Marc Mueller 7a89e58873
Use builtin TimeoutError [e-i] (#109679) 2024-02-05 12:00:37 +01:00
Jan Bouwhuis 4b8d8baa69
Remove deprecated YAML import from generic camera (#107992) 2024-01-14 09:36:00 +01:00
Daniel Schall 8778763a3e
Synchronize and cache Generic Camera still image fetching (#105821) 2023-12-27 21:19:25 +01:00
J. Nick Koston 608f4f7c52
Bump aiohttp to 3.9.1 (#104176) 2023-11-29 16:13:54 +01:00
Marc Mueller 02567d9bf6
Revert aiohttp to 3.8.5 for Python 3.11 (#101932) 2023-10-13 14:12:42 +02:00
Marc Mueller 3155e62510
Update aiohttp to 3.9.0b0 (#101627) 2023-10-08 13:21:46 +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
Meow a4b2ded503
Refactor deprecated RESULT_TYPE_* (#97367) 2023-07-30 19:27:30 +02:00
Dave T 35f21dcf9c
Add repair hint to deprecate generic camera yaml config (#96923) 2023-07-23 11:10:18 +02:00
J. Nick Koston 6dbe67e909
Bump httpx to 0.24.0 and httpcore to 0.17.0 (#91308) 2023-04-12 20:11:59 -10:00
epenet 853bd52a22
Adjust entity registry access in tests (1) (#88950) 2023-03-01 09:11:14 +01:00
epenet b68f502769
Add type hints to integration tests (part 7) (#87980) 2023-02-13 09:53:09 +01:00
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