Skip to content

Commit

Permalink
Merge the v0.12 branch now that Frigate v0.12 has been released (b…
Browse files Browse the repository at this point in the history
…lakeblackshear#458)

* Add proxies for MSE and WebRTC live view websockets (blakeblackshear#365)

* Add proxy views for new live view types and fix jsmpeg

* Fix current tests

* Adjust path

* Restore frigate integration path

* Restore frigate integration path

* Add other tests

* Fix tests

* Formatting

* Remove copied code

* FEAT: Support Frigate RTSP Restream (blakeblackshear#361)

* Support rtsp restream

* Add restream to config

* Update tests to account for restream

* Formatting

* Formatting

* Use template for RTSP

* Add RTSP config flow and tests

* Fix test

* Set restream type

* Adjust tests for extra attr

* Fix mypy

* Merge master back into the v0.12 branch (blakeblackshear#381)

* Bump actions/setup-python from 4.2.0 to 4.3.0 (blakeblackshear#357)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4.2.0...v4.3.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump crazy-max/ghaction-github-labeler from 4.0.0 to 4.1.0 (blakeblackshear#359)

Bumps [crazy-max/ghaction-github-labeler](https://github.com/crazy-max/ghaction-github-labeler) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/crazy-max/ghaction-github-labeler/releases)
- [Changelog](https://github.com/crazy-max/ghaction-github-labeler/blob/v4.1.0/CHANGELOG.md)
- [Commits](crazy-max/ghaction-github-labeler@v4.0.0...v4.1.0)

---
updated-dependencies:
- dependency-name: crazy-max/ghaction-github-labeler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump release-drafter/release-drafter from 5.20.1 to 5.21.1 (blakeblackshear#358)

Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.20.1 to 5.21.1.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](release-drafter/release-drafter@v5.20.1...v5.21.1)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix HACS add repository badge (blakeblackshear#367)

* Fix flake8 in the build. (blakeblackshear#380)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Felipe Santos <[email protected]>

* FEAT: Support sensors for per-process CPU usage (blakeblackshear#369)

* Bump actions/setup-python from 4.2.0 to 4.3.0 (blakeblackshear#357)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4.2.0...v4.3.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump crazy-max/ghaction-github-labeler from 4.0.0 to 4.1.0 (blakeblackshear#359)

Bumps [crazy-max/ghaction-github-labeler](https://github.com/crazy-max/ghaction-github-labeler) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/crazy-max/ghaction-github-labeler/releases)
- [Changelog](https://github.com/crazy-max/ghaction-github-labeler/blob/v4.1.0/CHANGELOG.md)
- [Commits](crazy-max/ghaction-github-labeler@v4.0.0...v4.1.0)

---
updated-dependencies:
- dependency-name: crazy-max/ghaction-github-labeler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump release-drafter/release-drafter from 5.20.1 to 5.21.1 (blakeblackshear#358)

Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.20.1 to 5.21.1.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](release-drafter/release-drafter@v5.20.1...v5.21.1)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix HACS add repository badge (blakeblackshear#367)

* Fix flake8 in the build. (blakeblackshear#380)

* Add cpu usage sensors

* Formatting

* Clean up and fix bugs

* Update stats to reflect new sensor

* Add tests

* Fix placement of test stats

* Add negative case tests

* Better default

* Move to attr_name

* Formatting

* Fix sorting

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Felipe Santos <[email protected]>
Co-authored-by: Dermot Duffy <[email protected]>

* Add sensor for gpu usage (blakeblackshear#344)

* Add sensor for gpu load

* Fix gpu access

* Fix var access

* Add tests

* Fix test

* Fix test

* Support Frigate v0.12 UTC based recording paths (blakeblackshear#384)

* Handle both date formats and convert new format to local server time

* Add test

* Formatting

* Fix test

* Format time

* Fix time formatting

* Fix mypy

* Redo logic for validating which folder structure is used

* More cleanup

* Don't provide name of error

* Formatting

* Remove TODO

* Bump version to v4.0.0-beta1. (blakeblackshear#390)

* [FEAT]: Birdseye Camera Entity with birdseye stream (blakeblackshear#386)

* Add birdseye camera entity

* Formatting

* Fix logic

* Add tests for birdseye camera

* Set full restream config

* Fix bad entity id

* Add ability to pull latest snapshot from birdseye

* Add test

* Fix entity access

* Add streaming template for birdseye

* Add test for birdseye template

* Fix set

* Fix formatting

* Rewrite recordings media source to use Recordings Summary API (blakeblackshear#389)

* Handle new folder structure

* Add timezone param to recordings summary

* Add dependency for tzlocal

* Rewrite recordings media source to use rcordings summary api

* Fixes

* Add req

* Format reqs

* Fix sort

* Try to fix test

* More test fixes

* More fixes

* Fix media root test

* Remove unused test

* More test fixes

* More test fixes

* Fix mypy

* More test fixes

* More test fixes

* Add types dep

* Raise and assert raises

* Add types dep

* Fix tests

* No exception

* assert media

* remove unused check

* Send exception

* Fix format string

* Fix api typing

* Formatting

* Mypy fixes

* More mypy fixes

* Undo

* Remove

* Formatting

* Set type specifically

* Formatting

* Review fixes

* Remove unused test

* Fix test for year

* Set type for hour items

* Remove explicit type set

* Add translations for RTSP template (blakeblackshear#391)

* Switch to region-agnostic media browser title formats (blakeblackshear#392)

* Switch to media browser title formats that are more suitable for international users

* Continue to validate y-m-d

* Fix binary sensor classes (blakeblackshear#398)

* Use the HA timezone setting for requesting recordings, provide timezone to event summary (blakeblackshear#397)

* Remove tzlocal

* Use HA timezone option to feed timezone

* Fix tests

* Fix tests

* Fix test with tiemzone

* remove constructor and pass to func

* Add timezone to event summary call

* Use pytz to convert timezone to utc before sending

* Fix timezone access

* Fix string

* Fix event summary call

* Fix timezone

* Fix tests

* Fix month formatting

* Mypy fixes

* Fix mypy and tests

* Cleanup timezone conversion

* Cleanup

* Fix mypy

* Fix mypy

* Bump to beta 2 (blakeblackshear#401)

* Expose timezone in ws_api . (blakeblackshear#410)

* Fix birdseye / restream (blakeblackshear#412)

* Fix birdseye / restream

* Fix tests

* Fix tests

* Put config in correct place

* Fix clearing go2rtc

* Fix template

* Update version (blakeblackshear#414)

* `_attr_is_streaming` should respect go2rtc streams (blakeblackshear#415)

* _attr_is_streaming was set True from old restream

* move is streaming check

* discard old restream check

* formating fix

* Change API to multi selection. (blakeblackshear#416)

* Force AAC audio to be used in RTSP URL (blakeblackshear#419)

* Force AAC audio to be used in RTSP URL

* Add reminder to remove after fix

* Allow searching for favorites via API. (blakeblackshear#420)

* Don't remove birdseye on startup (blakeblackshear#422)

* Update to beta4 (blakeblackshear#423)

* Merge master branch back into v0.12 branch (blakeblackshear#424)

* Bump actions/setup-python from 4.2.0 to 4.3.0 (blakeblackshear#357)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4.2.0...v4.3.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump crazy-max/ghaction-github-labeler from 4.0.0 to 4.1.0 (blakeblackshear#359)

Bumps [crazy-max/ghaction-github-labeler](https://github.com/crazy-max/ghaction-github-labeler) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/crazy-max/ghaction-github-labeler/releases)
- [Changelog](https://github.com/crazy-max/ghaction-github-labeler/blob/v4.1.0/CHANGELOG.md)
- [Commits](crazy-max/ghaction-github-labeler@v4.0.0...v4.1.0)

---
updated-dependencies:
- dependency-name: crazy-max/ghaction-github-labeler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump release-drafter/release-drafter from 5.20.1 to 5.21.1 (blakeblackshear#358)

Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.20.1 to 5.21.1.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](release-drafter/release-drafter@v5.20.1...v5.21.1)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix HACS add repository badge (blakeblackshear#367)

* Fix flake8 in the build. (blakeblackshear#380)

* Fix build badge. (blakeblackshear#385)

* Bump actions/checkout from 3.1.0 to 3.2.0 (blakeblackshear#383)

Bumps [actions/checkout](https://github.com/actions/checkout) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3.1.0...v3.2.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump actions/setup-python from 4.3.0 to 4.3.1 (blakeblackshear#378)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4.3.0...v4.3.1)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump actions/setup-python from 4.3.1 to 4.4.0 (blakeblackshear#387)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.3.1 to 4.4.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4.3.1...v4.4.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump release-drafter/release-drafter from 5.21.1 to 5.22.0 (blakeblackshear#394)

Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.21.1 to 5.22.0.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](release-drafter/release-drafter@v5.21.1...v5.22.0)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump actions/checkout from 3.2.0 to 3.3.0 (blakeblackshear#400)

Bumps [actions/checkout](https://github.com/actions/checkout) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3.2.0...v3.3.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump actions/setup-python from 4.4.0 to 4.5.0 (blakeblackshear#407)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.4.0 to 4.5.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4.4.0...v4.5.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Latest version check: add handling for "disabled" (blakeblackshear#417)

This goes alongside blakeblackshear/frigate#5208 to ensure that the HASS integration correctly handles the new "disabled" API response that occurs if the Frigate version update check is disabled.

* Update isort. (blakeblackshear#425)

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Felipe Santos <[email protected]>
Co-authored-by: James L <[email protected]>

* Merge updates for latest HomeAssistant (blakeblackshear#427)

* Bump actions/setup-python from 4.2.0 to 4.3.0 (blakeblackshear#357)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4.2.0...v4.3.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump crazy-max/ghaction-github-labeler from 4.0.0 to 4.1.0 (blakeblackshear#359)

Bumps [crazy-max/ghaction-github-labeler](https://github.com/crazy-max/ghaction-github-labeler) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/crazy-max/ghaction-github-labeler/releases)
- [Changelog](https://github.com/crazy-max/ghaction-github-labeler/blob/v4.1.0/CHANGELOG.md)
- [Commits](crazy-max/ghaction-github-labeler@v4.0.0...v4.1.0)

---
updated-dependencies:
- dependency-name: crazy-max/ghaction-github-labeler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump release-drafter/release-drafter from 5.20.1 to 5.21.1 (blakeblackshear#358)

Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.20.1 to 5.21.1.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](release-drafter/release-drafter@v5.20.1...v5.21.1)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix HACS add repository badge (blakeblackshear#367)

* Fix flake8 in the build. (blakeblackshear#380)

* Fix build badge. (blakeblackshear#385)

* Bump actions/checkout from 3.1.0 to 3.2.0 (blakeblackshear#383)

Bumps [actions/checkout](https://github.com/actions/checkout) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3.1.0...v3.2.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump actions/setup-python from 4.3.0 to 4.3.1 (blakeblackshear#378)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4.3.0...v4.3.1)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump actions/setup-python from 4.3.1 to 4.4.0 (blakeblackshear#387)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.3.1 to 4.4.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4.3.1...v4.4.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump release-drafter/release-drafter from 5.21.1 to 5.22.0 (blakeblackshear#394)

Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.21.1 to 5.22.0.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](release-drafter/release-drafter@v5.21.1...v5.22.0)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump actions/checkout from 3.2.0 to 3.3.0 (blakeblackshear#400)

Bumps [actions/checkout](https://github.com/actions/checkout) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3.2.0...v3.3.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump actions/setup-python from 4.4.0 to 4.5.0 (blakeblackshear#407)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.4.0 to 4.5.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4.4.0...v4.5.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Latest version check: add handling for "disabled" (blakeblackshear#417)

This goes alongside blakeblackshear/frigate#5208 to ensure that the HASS integration correctly handles the new "disabled" API response that occurs if the Frigate version update check is disabled.

* Update isort. (blakeblackshear#425)

* Fixes for Home Assistant 2023.1.7+, Python 3.9, Python 3.10 (blakeblackshear#426)

* Updates for Home Assistant 2023.1.7 and Python 3.9 .

* Fix for Python 3.10.

* Minor type fixes.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Felipe Santos <[email protected]>
Co-authored-by: James L <[email protected]>

* Fix handling of GPU error conditions in sensors (blakeblackshear#430)

* Fix handling of GPU error

* Update tests

* Clean up logic

* Revert "Force AAC audio to be used in RTSP URL (blakeblackshear#419)" (blakeblackshear#432)

This reverts commit b91d882, which is
no longer necessary since AlexxIT/go2rtc#194
was fixed.

* Allow API callers (e.g. the card) to search via sub_labels (blakeblackshear#444)

* Allow the card to search via sub_labels .

* Minor fix / sort.

* Fix test.

* Fix DST related test failure (blakeblackshear#452)

* Fix DST related test failure.

* Try the conversion from the HA local time instead.

* Save value of localized TZ.

* Bump version to v4.0.0-rc1 . (blakeblackshear#453)

* Update devcontainer versions. (blakeblackshear#455)

* Pin mypy

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Dermot Duffy <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Felipe Santos <[email protected]>
Co-authored-by: virtualm2000 <[email protected]>
Co-authored-by: James L <[email protected]>
  • Loading branch information
6 people authored Apr 12, 2023
1 parent 705fbef commit 7d3b0c7
Show file tree
Hide file tree
Showing 27 changed files with 1,170 additions and 442 deletions.
Binary file added .DS_Store
Binary file not shown.
9 changes: 7 additions & 2 deletions custom_components/frigate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@ async def async_setup(hass: HomeAssistant, config: Config) -> bool:

async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up this integration using UI."""

client = FrigateApiClient(entry.data.get(CONF_URL), async_get_clientsession(hass))
client = FrigateApiClient(
entry.data.get(CONF_URL),
async_get_clientsession(hass),
)
coordinator = FrigateDataUpdateCoordinator(hass, client=client)
await coordinator.async_config_entry_first_refresh()

Expand Down Expand Up @@ -208,6 +210,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
for item in get_cameras_and_zones(config):
current_devices.add(get_frigate_device_identifier(entry, item))

if config.get("birdseye", {}).get("restream", False):
current_devices.add(get_frigate_device_identifier(entry, "birdseye"))

device_registry = dr.async_get(hass)
for device_entry in dr.async_entries_for_config_entry(
device_registry, entry.entry_id
Expand Down
32 changes: 22 additions & 10 deletions custom_components/frigate/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,31 @@ async def async_get_stats(self) -> dict[str, Any]:

async def async_get_events(
self,
camera: str | None = None,
label: str | None = None,
zone: str | None = None,
cameras: list[str] | None = None,
labels: list[str] | None = None,
sub_labels: list[str] | None = None,
zones: list[str] | None = None,
after: int | None = None,
before: int | None = None,
limit: int | None = None,
has_clip: bool | None = None,
has_snapshot: bool | None = None,
favorites: bool | None = None,
decode_json: bool = True,
) -> list[dict[str, Any]]:
"""Get data from the API."""
params = {
"camera": camera,
"label": label,
"zone": zone,
"cameras": ",".join(cameras) if cameras else None,
"labels": ",".join(labels) if labels else None,
"sub_labels": ",".join(sub_labels) if sub_labels else None,
"zones": ",".join(zones) if zones else None,
"after": after,
"before": before,
"limit": limit,
"has_clip": int(has_clip) if has_clip is not None else None,
"has_snapshot": int(has_snapshot) if has_snapshot is not None else None,
"include_thumbnails": 0,
"favorites": int(favorites) if favorites is not None else None,
}

return cast(
Expand All @@ -93,12 +97,14 @@ async def async_get_event_summary(
self,
has_clip: bool | None = None,
has_snapshot: bool | None = None,
timezone: str | None = None,
decode_json: bool = True,
) -> list[dict[str, Any]]:
"""Get data from the API."""
params = {
"has_clip": int(has_clip) if has_clip is not None else None,
"has_snapshot": int(has_snapshot) if has_snapshot is not None else None,
"timezone": str(timezone) if timezone is not None else None,
}

return cast(
Expand Down Expand Up @@ -137,15 +143,21 @@ async def async_retain(
return cast(dict[str, Any], result) if decode_json else result

async def async_get_recordings_summary(
self, camera: str, decode_json: bool = True
) -> dict[str, Any] | str:
self, camera: str, timezone: str, decode_json: bool = True
) -> list[dict[str, Any]] | str:
"""Get recordings summary."""
params = {"timezone": timezone}

result = await self.api_wrapper(
"get",
str(URL(self._host) / f"api/{camera}/recordings/summary"),
str(
URL(self._host)
/ f"api/{camera}/recordings/summary"
% {k: v for k, v in params.items() if v is not None}
),
decode_json=decode_json,
)
return cast(dict[str, Any], result) if decode_json else result
return cast(list[dict[str, Any]], result) if decode_json else result

async def async_get_recordings(
self,
Expand Down
7 changes: 3 additions & 4 deletions custom_components/frigate/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
from typing import Any, cast

from homeassistant.components.binary_sensor import (
DEVICE_CLASS_MOTION,
DEVICE_CLASS_OCCUPANCY,
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
Expand Down Expand Up @@ -134,7 +133,7 @@ def is_on(self) -> bool:
@property
def device_class(self) -> str:
"""Return the device class."""
return cast(str, DEVICE_CLASS_OCCUPANCY)
return cast(str, BinarySensorDeviceClass.OCCUPANCY)

@property
def icon(self) -> str:
Expand Down Expand Up @@ -210,4 +209,4 @@ def is_on(self) -> bool:
@property
def device_class(self) -> str:
"""Return the device class."""
return cast(str, DEVICE_CLASS_MOTION)
return cast(str, BinarySensorDeviceClass.MOTION)
162 changes: 147 additions & 15 deletions custom_components/frigate/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
ATTR_EVENT_ID,
ATTR_FAVORITE,
CONF_RTMP_URL_TEMPLATE,
CONF_RTSP_URL_TEMPLATE,
DEVICE_CLASS_CAMERA,
DOMAIN,
NAME,
Expand Down Expand Up @@ -66,6 +67,11 @@ async def async_setup_entry(
FrigateMqttSnapshots(entry, frigate_config, cam_name, obj_name)
for cam_name, obj_name in get_cameras_and_objects(frigate_config, False)
]
+ (
[BirdseyeCamera(entry, frigate_client)]
if frigate_config.get("birdseye", {}).get("restream", False)
else []
)
)

# setup services
Expand All @@ -81,7 +87,7 @@ async def async_setup_entry(


class FrigateCamera(FrigateMQTTEntity, Camera): # type: ignore[misc]
"""Representation a Frigate camera."""
"""Representation of a Frigate camera."""

# sets the entity name to same as device name ex: camera.front_doorbell
_attr_name = None
Expand Down Expand Up @@ -130,7 +136,11 @@ def __init__(
# The device_class is used to filter out regular camera entities
# from motion camera entities on selectors
self._attr_device_class = DEVICE_CLASS_CAMERA
self._attr_is_streaming = self._camera_config.get("rtmp", {}).get("enabled")
self._attr_is_streaming = (
self._camera_config.get("rtmp", {}).get("enabled")
or self._cam_name
in self._frigate_config.get("go2rtc", {}).get("streams", {}).keys()
)
self._attr_is_recording = self._camera_config.get("record", {}).get("enabled")
self._attr_motion_detection_enabled = self._camera_config.get("motion", {}).get(
"enabled"
Expand All @@ -139,20 +149,48 @@ def __init__(
f"{frigate_config['mqtt']['topic_prefix']}" f"/{self._cam_name}/motion/set"
)

streaming_template = config_entry.options.get(
CONF_RTMP_URL_TEMPLATE, ""
).strip()

if streaming_template:
# Can't use homeassistant.helpers.template as it requires hass which
# is not available in the constructor, so use direct jinja2
# template instead. This means templates cannot access HomeAssistant
# state, but rather only the camera config.
self._stream_source = Template(streaming_template).render(
**self._camera_config
)
if (
self._cam_name
in self._frigate_config.get("go2rtc", {}).get("streams", {}).keys()
):
self._restream_type = "rtsp"
streaming_template = config_entry.options.get(
CONF_RTSP_URL_TEMPLATE, ""
).strip()

if streaming_template:
# Can't use homeassistant.helpers.template as it requires hass which
# is not available in the constructor, so use direct jinja2
# template instead. This means templates cannot access HomeAssistant
# state, but rather only the camera config.
self._stream_source = Template(streaming_template).render(
**self._camera_config
)
else:
self._stream_source = (
f"rtsp://{URL(self._url).host}:8554/{self._cam_name}"
)

elif self._camera_config.get("rtmp", {}).get("enabled"):
self._restream_type = "rtmp"
streaming_template = config_entry.options.get(
CONF_RTMP_URL_TEMPLATE, ""
).strip()

if streaming_template:
# Can't use homeassistant.helpers.template as it requires hass which
# is not available in the constructor, so use direct jinja2
# template instead. This means templates cannot access HomeAssistant
# state, but rather only the camera config.
self._stream_source = Template(streaming_template).render(
**self._camera_config
)
else:
self._stream_source = (
f"rtmp://{URL(self._url).host}/live/{self._cam_name}"
)
else:
self._stream_source = f"rtmp://{URL(self._url).host}/live/{self._cam_name}"
self._restream_type = "none"

@callback # type: ignore[misc]
def _state_message_received(self, msg: ReceiveMessage) -> None:
Expand Down Expand Up @@ -189,6 +227,13 @@ def device_info(self) -> dict[str, Any]:
"manufacturer": NAME,
}

@property
def extra_state_attributes(self) -> dict[str, str]:
"""Return entity specific state attributes."""
return {
"restream_type": self._restream_type,
}

@property
def supported_features(self) -> int:
"""Return supported features of this camera."""
Expand Down Expand Up @@ -244,6 +289,93 @@ async def favorite_event(self, event_id: str, favorite: bool) -> None:
await self._client.async_retain(event_id, favorite)


class BirdseyeCamera(FrigateEntity, Camera): # type: ignore[misc]
"""Representation of the Frigate birdseye camera."""

# sets the entity name to same as device name ex: camera.front_doorbell
_attr_name = None

def __init__(
self,
config_entry: ConfigEntry,
frigate_client: FrigateApiClient,
) -> None:
"""Initialize the birdseye camera."""
self._client = frigate_client
FrigateEntity.__init__(self, config_entry)
Camera.__init__(self)
self._url = config_entry.data[CONF_URL]
self._attr_is_on = True
# The device_class is used to filter out regular camera entities
# from motion camera entities on selectors
self._attr_device_class = DEVICE_CLASS_CAMERA
self._attr_is_streaming = True
self._attr_is_recording = False

streaming_template = config_entry.options.get(
CONF_RTSP_URL_TEMPLATE, ""
).strip()

if streaming_template:
# Can't use homeassistant.helpers.template as it requires hass which
# is not available in the constructor, so use direct jinja2
# template instead. This means templates cannot access HomeAssistant
# state, but rather only the camera config.
self._stream_source = Template(streaming_template).render(
{"name": "birdseye"}
)
else:
self._stream_source = f"rtsp://{URL(self._url).host}:8554/birdseye"

@property
def unique_id(self) -> str:
"""Return a unique ID to use for this entity."""
return get_frigate_entity_unique_id(
self._config_entry.entry_id,
"camera",
"birdseye",
)

@property
def device_info(self) -> dict[str, Any]:
"""Return the device information."""
return {
"identifiers": {
get_frigate_device_identifier(self._config_entry, "birdseye")
},
"via_device": get_frigate_device_identifier(self._config_entry),
"name": "Birdseye",
"model": self._get_model(),
"configuration_url": f"{self._url}/cameras/birdseye",
"manufacturer": NAME,
}

@property
def supported_features(self) -> int:
"""Return supported features of this camera."""
return cast(int, CameraEntityFeature.STREAM)

async def async_camera_image(
self, width: int | None = None, height: int | None = None
) -> bytes | None:
"""Return bytes of camera image."""
websession = cast(aiohttp.ClientSession, async_get_clientsession(self.hass))

image_url = str(
URL(self._url)
/ "api/birdseye/latest.jpg"
% ({"h": height} if height is not None and height > 0 else {})
)

async with async_timeout.timeout(10):
response = await websession.get(image_url)
return await response.read()

async def stream_source(self) -> str | None:
"""Return the source of the stream."""
return self._stream_source


class FrigateMqttSnapshots(FrigateMQTTEntity, Camera): # type: ignore[misc]
"""Frigate best camera class."""

Expand Down
11 changes: 11 additions & 0 deletions custom_components/frigate/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
CONF_NOTIFICATION_PROXY_ENABLE,
CONF_NOTIFICATION_PROXY_EXPIRE_AFTER_SECONDS,
CONF_RTMP_URL_TEMPLATE,
CONF_RTSP_URL_TEMPLATE,
DEFAULT_HOST,
DOMAIN,
)
Expand Down Expand Up @@ -143,6 +144,16 @@ async def async_step_init(
"",
),
): str,
# The input URL is not validated as being a URL to allow for the
# possibility the template input won't be a valid URL until after
# it's rendered.
vol.Optional(
CONF_RTSP_URL_TEMPLATE,
default=self._config_entry.options.get(
CONF_RTSP_URL_TEMPLATE,
"",
),
): str,
vol.Optional(
CONF_NOTIFICATION_PROXY_ENABLE,
default=self._config_entry.options.get(
Expand Down
1 change: 1 addition & 0 deletions custom_components/frigate/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
CONF_PASSWORD = "password"
CONF_PATH = "path"
CONF_RTMP_URL_TEMPLATE = "rtmp_url_template"
CONF_RTSP_URL_TEMPLATE = "rtsp_url_template"
CONF_NOTIFICATION_PROXY_EXPIRE_AFTER_SECONDS = "notification_proxy_expire_after_seconds"

# Defaults
Expand Down
18 changes: 9 additions & 9 deletions custom_components/frigate/manifest.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"domain": "frigate",
"documentation": "https://github.com/blakeblackshear/frigate",
"name": "Frigate",
"version": "3.0.1",
"issue_tracker": "https://github.com/blakeblackshear/frigate-hass-integration/issues",
"codeowners": [
"@blakeblackshear"
],
"config_flow": true,
"dependencies": [
"http",
"media_source",
"mqtt"
],
"config_flow": true,
"codeowners": [
"@blakeblackshear"
],
"requirements": [],
"iot_class": "local_push"
"documentation": "https://github.com/blakeblackshear/frigate",
"iot_class": "local_push",
"issue_tracker": "https://github.com/blakeblackshear/frigate-hass-integration/issues",
"requirements": ["pytz==2022.7"],
"version": "4.0.0"
}
Loading

0 comments on commit 7d3b0c7

Please sign in to comment.