Commit Graph

84 Commits (4f32a329a794e5dae4b0745a4e505fb3e8d5d876)

Author SHA1 Message Date
Allen Porter 14e4216e29
Put access to ffmpeg hass.data behind a method (#62570)
* Put access to ffmpeg hass.data behind a method

Move all callers of `hass.data[DATA_FFMPEG]` to a new function that returns the FFMpegManager.

* Update homeassistant/components/ffmpeg/__init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Remove unnecessary async_ prefix

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-12-21 23:40:43 -08:00
epenet e4e0dcbae0
Use new BinarySensorDeviceClass enum in amcrest (#61268)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-08 12:13:18 -08:00
Marc Mueller b60b38c6f6
Fix amcrest pylint issue (#60932) 2021-12-03 20:14:21 +01:00
Pedro Rodriguez Tavarez e0562385f1
Implement privacy_mode for amcrest integration (#57210) 2021-12-03 10:00:39 -08:00
Franck Nijhof 6b9c2d8295
Add shorthand attribute support to Camera platform (#59837) 2021-11-25 16:03:53 +01:00
Marc Mueller 5048bad050
Use assignment expressions 05 (#57785) 2021-10-17 19:56:00 +02:00
Sean Vig f18e4bab60
Add resolution to Amcrest camera unique id (#56207)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-09-30 13:38:18 +02:00
Marc Mueller 565a9fea6b
Import Callable from collections.abc (2) (#56776) 2021-09-29 14:06:51 +02:00
Sean Vig 02ba3c6089
Update amcrest version to 1.9.3 (#56348)
This version fixes a bug that affects the current non-async Home Assistant integration
2021-09-18 08:34:51 +02:00
Sean Vig 6d99a7a730
Add unique id to amcrest sensors (#55243)
* Add unique id to amcrest sensors

* Change 'unique_id' to 'serial_number' on api wrapper

* Update unique id's with channel value that can be used in future changes and remove unrelated camera changes
2021-09-17 07:48:17 +02:00
Sean Vig 69ff7a968a
Bump amcrest version to 1.9.2 (#56281) 2021-09-16 06:53:40 +02:00
Sean Vig a180c3f813
Fix polling on online Amcrest binary sensor (#56106) 2021-09-12 20:45:52 -07:00
Sean Vig 03df48af9c
Bump amcrest version to 1.8.1 (#56058)
The current version of the `amcrest` package has a bug in exposing if
the video stream is enabled, which leads to the substream status being
used to set if the camera is on or off.  The updated version of
`amcrest` fixes this bug.

Fixes #55661
2021-09-10 15:38:01 +02:00
Sean Vig 789f21c427
Fix assignment of amcrest camera model (#55266) 2021-09-07 04:52:45 +02:00
Sean Vig b45c985d58
Remove un-needed asserts on hass in Amecrest (#55244) 2021-08-26 08:34:58 +02:00
Sean Vig 6b4e3bca6f
Add type annotations to amcrest integration (#54761)
Co-authored-by: Milan Meulemans <milan.meulemans@live.be>
2021-08-25 13:24:29 +02:00
Sean Vig 5cbb217318
Update amcrest to use binary sensor entity description (#55092) 2021-08-24 14:06:19 +02:00
Marc Mueller 1f6a70bafd
Use EntityDescription - amcrest (#54998) 2021-08-23 22:32:01 +02:00
Brian Egge 6cefd558d8
Set unique id to amcrest serial number (#54675)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Sean Vig <sean.v.775@gmail.com>
2021-08-21 19:58:37 +02:00
Erik Montnemery 4e07ab1b32
Move temperature conversions to sensor base class (1/8) (#48261)
* Move temperature conversions to entity base class (1/8)

* Update integrations a-c

* Leave old temperature conversion until all integrations are migrated

* tweak

* Use contextlib.suppress

* Remove the MeasurableUnitEntity mixin

* Address comments, add tests

* Fix f-string

* Drop deprecation warning from base entity class

* Update with _attr-shorthand

* Fix rebase mistakes

* Fix additional rebase mistakes

* Only report temperature conversion once

* Fix additional rebase mistakes

* Format homeassistant/components/bbox/sensor.py

* Fix check for overidden _attr_state

* Remove test workarounds from implementation

* Remove useless None-check

* Tweaks

* Migrate new sensors a-c

* Update climacell

* Push deprecation of temperature conversion forward

* Override __repr__ in SensorEntity

* Include native_value in SensorEntity attributes

* Pylint

* Black

* Black

* Fix rebase mistakes

* black

* Fix rebase mistakes

* Revert changes in august/sensor.py

* Revert handling of unit converted restored state

* Apply code review suggestion

* Fix arlo test
2021-08-11 10:45:05 +02:00
J. Nick Koston e99576c094
Pass width and height when requesting camera snapshot (#53835) 2021-08-10 19:33:06 -05:00
jan iversen 1d40a6e407
Activate mypy from amcrest and make the needed changes (#54392) 2021-08-10 14:57:57 +02:00
Sean Vig 673be4f7dd
Bump Amcrest version to 1.8.0 (#53784)
* Bump Amcrest version to 1.8.0
* Add codeowner to Amcrest.

Co-authored-by: jan Iversen <jancasacondor@gmail.com>
2021-08-01 00:22:19 +02:00
tkdrob 028a07d86f
Wrap up selectors (#50794)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-05-25 14:45:17 +02:00
Julien "_FrnchFrgg_" Rivaud 24a46d91d3
Fix amcrest detection of sensor reset (#50249)
Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2021-05-10 10:49:08 -07:00
tkdrob e92516c072
Add targets and selectors to services (A) (#49818) 2021-05-09 02:21:00 +02:00
Franck Nijhof 055cdc64c0
Add support for IoT class in manifest (#46935) 2021-04-15 10:21:38 +02:00
Julien "_FrnchFrgg_" Rivaud 5a9c3fea70
Enable passing Amcrest/Dahua signals through as HA events (#49004)
Some of the compatible hardware sends event signals that wouldn't map
well to entities, e.g. NTP sync notifications, SIP registering
information, or « doorbell button pressed » events with no « return to
rest state » matching event to have a properly behaved binary sensor.

Instead of only monitoring specific events, subscribe to all of them,
and pass them through (in addition to handling them as before if they
correspond to a configured binary sensor).

Also bump python-amcrest to 1.7.2. Digest of the changes:

* The library now passes through the event data instead of just presence of a
 "Start" member in in.
* Connection to some devices has been fixed by not throwing the towel on
  minor errors.

https://github.com/tchellomello/python-amcrest/compare/1.7.1...1.7.2
2021-04-13 21:33:46 +02:00
Franck Nijhof de569982a4
Fix services for Armcrest & Logi Circle (#49166) 2021-04-13 16:32:39 +02:00
Tobias Sauerwein 2b79c91813
Clean up camera service schema (#49151) 2021-04-13 13:07:05 +02:00
Phil Bruckner f538ea1827
Release ownership of amcrest integration (#49086)
I no longer use this integration and others have taken over maintenance.
2021-04-11 21:44:22 -05:00
Franck Nijhof 6932cf9534
Use contextlib.suppress where possible (#48189) 2021-03-23 14:36:43 +01:00
Erik Montnemery e0cd7072d6
Migrate integrations a-c to extend SensorEntity (#48210) 2021-03-22 12:37:16 +01:00
J. Nick Koston c820dd4cb5
Have pylint warn when user visible log messages do not start with capital letter or end with a period (#48064)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-03-19 09:26:36 -05:00
Andreas 00dca88024
Amcrest add support for CrossLineDetection (#44582)
Co-authored-by: andreas-amlabs <andreas-amlabs@users.noreply.github.com>
2021-03-18 12:32:08 +01:00
Erik Montnemery 6c084ae6ce
Update integrations a-e to override extra_state_attributes() (#47756) 2021-03-11 16:51:03 +01:00
Phil Bruckner 2472dad1fa
Bump amcrest package version to 1.7.1 (#47483) 2021-03-05 15:05:36 -08:00
Paulus Schoutsen 0cf3736162
Bump ha-ffmpeg to 3.0.2 (#43597) 2020-11-25 08:45:15 +01:00
springstan d2b1918e9c
Drop UNIT_ prefix for percentage constant (#39383) 2020-09-05 21:09:14 +02:00
Phil Bruckner f6f84fc201
Add Amcrest audio_detected binary sensor (#37486) 2020-07-05 18:54:17 -04:00
Phil Bruckner c423501804
Add legacy polling option for Amcrest motion detection (#36955) 2020-06-24 23:20:39 -07:00
Phil Bruckner d68148417f
Retry failed Amcrest commands that change settings (#36917) 2020-06-22 18:36:41 -07:00
Erik Montnemery b022e08db9
Rename BinarySensorDevice to BinarySensorEntity (#34462)
* Rename BinarySensorDevice to BinarySensorEntity

* Tweak

* Move deprecation warning to __new__, add test

* Move deprecation warning back to __init__

* Move deprecation warning to __init_subclass
2020-04-23 21:57:07 +02:00
Franck Nijhof 39336d3ea3
Add prettier (in pre-commit and CI) (#33693)
* Add prettier (in pre-commit and CI)

* Make all file prettier

* Change order

* Add to Azure Pipelines

* Fix a YAML file prettier caught as invalid

* Remove flow mapping using curly braces from all YAML service files
2020-04-05 17:27:16 +02:00
GaryOkie 414559f018
Enable incremental Pan/Tilt/Zoom capability to Amcrest/Dahua cameras (#32839)
Add new "amcrest.ptz_control" service to specify a PTZ camera movement or zoom direction (up, down, right, left, right_up, right_down, left_up, left_down, zoom_in, zoom_out). An optional travel_time attribute specifies the amount of movement between start/stop.
2020-03-20 11:34:42 -05:00
Phil Bruckner 0ed7bc3b8e
Convert amcrest binary sensors from poll to stream (#32818)
* Convert amcrest binary sensors from poll to stream

- Bump amcrest package to 1.6.0.
- For online binary sensor poll camera periodically to test communications in case
  configuration & usage results in no other communication to camera.
- Start a separate thread to call camera's event_stream method since it never returns.
- Convert all received events into signals that cause corresponding sensors to update.
- Use camera's generic event_channels_happened method to update sensors at startup,
  and whenever camera comes back online after being unavailable.

* Changes per review

* Changes per review 2

* Changes per review 3

- Move event stream decoding to amcrest package.
- Change name of event processing threads so global
  counter is no longer required.
- Bump amcrest package to 1.7.0.
2020-03-19 21:07:21 -07:00
springstan f1a0ca7cd3
Add and use percentage constant (#32094)
* Add and use percentage constant

* Fix pylint error and broken test
2020-02-28 11:46:48 -08:00
Ville Skyttä 9b2544c923
Remove some unneeded pylint suppressions (#32152) 2020-02-24 16:47:15 -08:00
springstan 524a1a7587
Use f-strings in integrations starting with "A" (#32110)
* Use f-strings in integrations starting with A

* Use f-strings in tests for integrations starting with A

* Fix pylint by renaming variable

* Fix nested for loop in f-string for aprs device_tracker

* Break long lines into multiple short lines

* Break long lines into multiple short lines v2
2020-02-23 13:38:05 -08:00
Phil Bruckner d1e7ade6db
Make amcrest integration more robust (#30843)
- Bump amcrest package to 1.5.6. Includes networking improvements, no longer
  communicates during Http.__init__(), and allows running snapshot command
  without using stream mode.
- Handle login errors better, and not just at startup.
- Increase network connect & read timeout to 6.05 seconds.
- Increase network read timeout to 20 seconds for snapshot command.
- Run snapshot command in separate task, that cannot be cancelled, to eliminate
  possibility of two snapshot commands running simultaneously (since
  AmcrestCam.async_camera_image can be cancelled.) Also makes sure any exceptions
  from the command are caught properly.
2020-02-06 14:44:48 -06:00