Commit Graph

662 Commits

Author SHA1 Message Date
Marc Mueller
3a5acd6a57 Use VolDictType for service schemas (#120403) 2024-06-25 12:33:41 +02:00
tronikos
2ca580898d Fix typo in Camera.turn_on (#119386) 2024-06-12 08:50:34 -04:00
J. Nick Koston
09e7156d2d Fix turbojpeg init doing blocking I/O in the event loop (#117971)
* Fix turbojpeg init doing blocking I/O in the event loop

fixes
```
Detected blocking call to open inside the event loop by integration camera at homeassistant/components/camera/img_util.py, line 100: TurboJPEGSingleton.__instance = TurboJPEG() (offender: /usr/local/lib/python3.12/ctypes/util.py, line 276: with open(filepath, rb) as fh:), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+camera%22
```

* Update homeassistant/components/camera/img_util.py

* Fix turbojpeg init doing blocking I/O in the event loop

fixes
```
Detected blocking call to open inside the event loop by integration camera at homeassistant/components/camera/img_util.py, line 100: TurboJPEGSingleton.__instance = TurboJPEG() (offender: /usr/local/lib/python3.12/ctypes/util.py, line 276: with open(filepath, rb) as fh:), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+camera%22
```

* already suppressed and logged
2024-05-23 10:50:25 -04:00
Marc Mueller
87bb7ced79 Use PEP 695 for simple type aliases (#117633) 2024-05-17 14:42:21 +02:00
Sid
2cc916db6d Replace pylint broad-except with Ruff BLE001 (#116250) 2024-05-07 14:00:27 +02:00
J. Nick Koston
0b3627b59e Add additional cached_property to camera entities (#115075) 2024-04-13 16:50:11 -05:00
J. Nick Koston
ca5ed274cb Deprecate calling async_listen and async_listen_once with run_immediately (#115169) 2024-04-08 10:07:54 -10:00
Marc Mueller
816ce116bf Remove unnecessary functools.cached_property backport (#114239) 2024-04-04 11:24:26 +02:00
J. Nick Koston
ec3db0a6aa Migrate camera listeners to use run_immediately (#113840)
None of these need a call_soon
2024-03-19 19:58:59 -04:00
Sid
82a60fe8ad Enable Ruff RSE (#113695) 2024-03-18 00:40:38 +01:00
J. Nick Koston
9cc0006b92 Ensure TurboJPEG is imported in the executor (#113504)
The import was too late and it eneded up being imported
in the event loop
2024-03-15 12:23:53 +01:00
On Freund
b9837a561b Use friendly name for camera media source (#110882) 2024-03-12 21:20:14 +01:00
Marc Mueller
ff3a801936 Add empty line after module docstring [a-d] (#112697) 2024-03-08 14:51:32 +01:00
Paulus Schoutsen
dd1ad71166 Only load camera prefs once (#112064) 2024-03-02 17:18:34 -05:00
Jan-Philipp Benecke
259171eda9 Revert "Remove @bind_hass from camera functions" (#111703)
Revert "Remove `@bind_hass` from `camera` functions (#111494)"

This reverts commit c890c1aeee.
2024-02-28 10:51:04 +01:00
Jan-Philipp Benecke
c890c1aeee Remove @bind_hass from camera functions (#111494)
* Remove `@bind_hass` from camera functions

* Pass hass to async_get_image in image_processing
2024-02-27 23:01:43 +01:00
On Freund
32dc8d9fcb Improve code comment for Chrome frame bug in Camera (#111504) 2024-02-26 15:30:35 -05:00
On Freund
e879ab0eef Show WebRTC cameras that also support HLS in the media browser (#108796)
* Show WebRTC cameras in the media browser

* Only show webrtc cameras with source in the browser

* Address code review

* Refactor BrowseMediaSource creation

* Refactor

* Address code review
2024-02-18 10:12:08 -08:00
Marc Mueller
c82933175d Use builtin TimeoutError [a-d] (#109678) 2024-02-05 11:31:33 +01:00
J. Nick Koston
5a35c2e1e9 Fix stale camera error message in img_util (#109325) 2024-02-01 22:39:44 +01:00
Franck Nijhof
b2ba808779 Add camera icon translations (#108419)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-01-20 11:39:13 +01:00
J. Nick Koston
a0b00d78b1 Avoid duplicate property lookups in camera state_attributes (#107627) 2024-01-09 08:16:19 +01:00
Erik Montnemery
c805ea7b4f Include deprecated constants in wildcard imports (#107114) 2024-01-05 11:46:45 +01:00
J. Nick Koston
6506a8d511 Camera platform back-compat for custom components without CameraEntityFeature (#106529) 2023-12-29 00:45:35 +01:00
Daniel Schall
485a02c89d Fix Generic Camera interval calculation (#105820) 2023-12-27 13:45:49 +01:00
J. Nick Koston
c7b4f8f780 Use faster contains check in camera for stream feature (#106429) 2023-12-26 10:48:31 -10:00
J. Nick Koston
abd3c54cbe Add support for attribute caching to the camera platform (#106256) 2023-12-23 13:01:47 -10:00
Robert Resch
20ba764d92 Deprecate deprecated camera constants (#106095) 2023-12-23 10:46:23 +01:00
Michael
58070e14a7 Add significant Change support for camera (#105866) 2023-12-18 14:40:55 +01:00
Erik Montnemery
104bcc64b7 Allow inheriting base component entity descriptions in frozen dataclasses (#105512)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-12-15 23:33:50 -10:00
Erik Montnemery
df73850f56 Move definition of attributes excluded from history to entity classes (#100430)
* Move definition of attributes excluded from history to entity classes

* Revert change which should be in a follow-up PR

* Fix sun unrecorded attributes

* Fix input_select unrecorded attributes
2023-09-21 15:02:47 +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
Ville Skyttä
3094991236 Upgrade ruff to 0.0.285 (#98647) 2023-08-19 08:17:17 -04:00
Marc Mueller
a9ade1f84d Use asyncio.timeout [core] (#98447) 2023-08-15 08:36:05 -05:00
Franck Nijhof
30058297cf Migrate backported StrEnum to built-in StrEnum (#97101) 2023-07-23 23:19:24 +02:00
Joost Lekkerkerker
b367c95c81 Add more common translations (#96429)
* Add common translations

* Add common translations

* Add common translations

* Add common translations

* Add common translations

* Add common translations

* Add common translations

* Add common translations
2023-07-12 22:00:05 -04:00
Franck Nijhof
76e3272432 Migrate camera services to support translations (#96313)
* Migrate camera services to support translations

* Apply suggestions from code review

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>

* Update homeassistant/components/camera/strings.json

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>

---------

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
2023-07-11 21:59:08 +02:00
J. Nick Koston
51344d566e Small speed up to cameras (#96124) 2023-07-08 09:23:45 +02:00
Franck Nijhof
372687fe81 Update PyTurboJPEG to 1.7.1 (#96104) 2023-07-07 08:02:47 -10:00
Erik Montnemery
86a397720f Move platform_integration_no_support issue to the homeassistant integration (#95927)
* Move platform_integration_no_support issue to the homeassistant integration

* Update test

* Improve repair text

* Update test
2023-07-07 13:31:54 +02:00
J. Nick Koston
89cc57c0d6 Fix double state write on camera added to hass when rtsp_to_webrtc is present (#93806) 2023-05-30 19:43:48 +02:00
G Johansson
c6feb30c31 Raise issue "does not support platform setup" (#93585)
* Raise issue on platform missing

* Modify issue

* Remove deprecation

* Fix strings

* Strings

* Last strings

* strings to common
2023-05-28 21:53:32 +02:00
J. Nick Koston
e4744199ce Raise an exception when trying to save camera snapshots to a not allowed path (#91869) 2023-04-23 01:15:56 +02:00
epenet
c01b1eb013 Adjust async_track_time_interval name argument (#90838)
Adjust async_track_time_interval naming
2023-04-05 10:58:02 -04:00
Erik Montnemery
e22618a555 Write protect entity options (#90185) 2023-03-28 22:56:51 +02:00
J. Nick Koston
02ef7d445d Allow passing an optional name to async_track_time_interval (#90244)
* Allow passing an optional name to async_track_time_interval

This is the same idea as passing a name to asyncio.create_task which
makes it easier to track down bugs

* more

* short

* still cannot find it

* add a few more

* test
2023-03-25 10:11:14 -04:00
Franck Nijhof
b9ff69d3ac Extend attribute state translations for Camera (#89876)
* Extend attribute state translations for Camera

* Add common generic translations
2023-03-20 08:39:20 -04:00
Franck Nijhof
f9919bb7cf Add pre-defined entity name translations (#89792) 2023-03-16 21:10:20 +01:00
Franck Nijhof
f32b7859b8 Restructure translations for entity components (#89702) 2023-03-16 12:16:08 +01:00
Robert Svensson
5a499050f2 Remove lingering timer related to camera (#89394) 2023-03-08 15:52:01 -05:00