Commit Graph

121 Commits (c900e3030b81ed25859911c3c3100713b24cf52b)

Author SHA1 Message Date
J. Nick Koston fd310e1f41
Update homekit to improve representation of activity based remotes (#47261) 2021-03-21 21:55:20 -07: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
J. Nick Koston 15aa00d6cc
Fix homekit checking for port cleanup too many times (#47836)
* Fix homekit checking for port cleanup too many times

The loop should have terminated as soon as the port was available

* coverage

* tweak homekit shutdown wait
2021-03-15 05:14:46 +01:00
J. Nick Koston f4b775b125
Cleanup homekit and remove aid storage from hass.data (#47488) 2021-03-11 22:05:03 -08:00
J. Nick Koston 2e89f152ba
Bump HAP-python to 3.4.0 (#47476)
* Bump HAP-python to 3.3.3

* bump

* fix mocking
2021-03-07 01:30:57 +01:00
Franck Nijhof 61be29117d
Deprecate HomeKit auto start (#47470) 2021-03-05 11:51:49 -08:00
Ville Skyttä dc880118a4
Lint suppression cleanups (#47248)
* Unused pylint suppression cleanups

* Remove outdated pylint bug references

* Add flake8-noqa config and note to run it every now and then

* Add codes to noqa's

* Unused noqa cleanups
2021-03-02 09:02:04 +01:00
J. Nick Koston 853da40e70
Increment the homekit config version when restarting (#47209)
If an entity changes between restart the iOS/controller
device may have cached the old chars for the accessory.
To force the iOS/controller to reload the chars, we
increment the config version when Home Assistant restarts
2021-02-28 20:42:09 -08:00
J. Nick Koston 87cbbcb014
Automatically create HomeKit accessory mode entries (#46473)
When we set up HomeKit, we asked users if they wanted
to create an entry in bridge or accessory mode.

This approach required the user to understand how HomeKit works and
choose which type to create.

When the user includes the media player or camera domains,
we exclude them from the bridge and create the additional entries
for each entity in accessory mode.
2021-02-23 16:22:23 -08:00
J. Nick Koston 20d93b4b29
Remove support for migrating pre-config entry homekit (#46616)
HomeKit pairings and accessory ids from versions 0.109 and earlier are no longer
migrated on upgrade. Users upgrading directly to 2021.3 from 0.109
and older should upgrade to 2021.2 first if they wish to preserve
HomeKit configuration and avoid re-pairing the bridge.

This change does not affect upgrades from 0.110 and later.
2021-02-16 08:37:43 +01:00
J. Nick Koston bc8a52038b
Fix homekit migration not being awaited (#46460) 2021-02-12 08:45:19 -10:00
J. Nick Koston 463a32819c
Ensure homekit never picks a port that another config entry uses (#45433) 2021-02-02 14:30:38 +01:00
J. Nick Koston 385b7e17ef
Move homekit accessory creation to async (#45788) 2021-01-31 11:36:19 -10:00
J. Nick Koston 5f9a1d105c
Improve HomeKit Accessory Mode UX (#45402) 2021-01-29 09:57:13 -06:00
J. Nick Koston af21893652
Remove safe mode from HomeKit (#45028)
Safe mode was added to work around a race condition where
the mdns announcment was sent too early and would cause
pairing to fail. Since this has been corrected in
HAP-python, there is no longer a need to have
safe mode.
2021-01-11 14:26:09 +01:00
J. Nick Koston f5b389faa8
Warn users when their HomeKit configuration may be unstable (#44999) 2021-01-10 09:38:41 -10:00
J. Nick Koston a3061ebd8d
Fix homekit bridges when no name was provided (#43364) 2020-11-19 12:10:23 +01:00
Lindsay Ward 181811b7b8
Fix typo exceeded, change to exceed, in HomeKit (#42705) 2020-11-01 03:51:56 -10:00
J. Nick Koston 2858a90d5c
Start homekit bridges with asyncio.gather (#42498) 2020-10-27 19:58:07 -05:00
J. Nick Koston 3ffa050905
Support HomeKit accessory mode (#41679)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-10-15 11:59:50 -05:00
J. Nick Koston bf1ad0a757
Prevent missing integration from failing HomeKit startup (#39918) 2020-09-10 23:19:11 +02:00
Ville Skyttä 6ae9399237
Upgrade isort to 5.4.2 (#37939) 2020-08-29 08:23:55 +02:00
Ville Skyttä 1bf2c4d976
Upgrade pylint to 2.6.0 (#39363) 2020-08-29 07:59:24 +02:00
J. Nick Koston 414a59ae9f
Add the ability to reload homekit from yaml (#39326) 2020-08-28 16:46:45 +02:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Austin Drummond 9d0f58009e
Add support for HomeKit doorbell (#38419)
* Add support for HomeKit doorbell

* Update homeassistant/components/homekit/type_cameras.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/homekit/type_cameras.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* add speaker service for doorbells

* fixed test as doorbell char requires null value

* removed null value for doorbell presses. and removed broken override of default values

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-07-31 09:41:36 -10:00
J. Nick Koston 27ef8a1ced
Ensure homekit accessory reset only affect the bridges with the accessory (#37588) 2020-07-06 17:27:25 -07:00
Franck Nijhof 53545c984b
Log lines do not end with a full stop (#37527) 2020-07-05 23:04:19 +02:00
J. Nick Koston debb928b30
Use the main event loop for homekit (#37441)
* use hass.loop for homekit

* update calls for upstream pr

* Bump HAP-python to 2.9.2
2020-07-05 12:27:07 -05:00
Shulyaka 4ec71c58bd
Add humidifier support to homekit (#37207)
* Add humidifier support to homekit

* spell

* dependencies

* lint

* add linked humidity sensor for humidifiers

* Apply suggestions from code review

Co-authored-by: J. Nick Koston <nick@koston.org>

* apply suggestions from code review

* pylint

* Fix tests

* Update homeassistant/components/homekit/type_humidifiers.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update tests/components/homekit/test_homekit.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Apply suggestions from code review

Co-authored-by: J. Nick Koston <nick@koston.org>

* apply suggestions from code review

* lint

* pylint

* push

* test for unavailable linker sensor

* black

* valid values key case

* black

* Update homeassistant/components/homekit/type_humidifiers.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* black

* coverage

* Set current humidity to 0 if linked sensor removed or unavailable

* use last known humidity instead

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-07-02 12:53:11 -05:00
J. Nick Koston 0f72008090
Ensure homekit state changed listeners are unsubscribed on reload (#37200)
* Ensure homekit state changed listeners are unsubscribed on reload

* fix mocking
2020-06-29 11:25:26 -05:00
J. Nick Koston 7b4df98875
Silence spurious warning when HomeKit is already running (#37199)
If homekit.start is called when homekit is already running
we previous warned.  Downgrade the warning to a debug message
as nothing is actually wrong.
2020-06-29 13:37:56 +02:00
Paulus Schoutsen 5bc6ed4cef
Add logbook platforms (#37078)
* Add logbook platforms

* Fix logbook describe test
2020-06-24 18:14:50 -07:00
mdegat01 6c7355785a
Add support for glob matching to entity filters (#36913)
* Added GLOB capability to entityfilter and every place that uses it. All existing tests are passing

* added tests for components affected by glob change

* fixed flake8 error

* mocking the correct listener

* mocking correct bus method in azure test

* tests passing in 3.7 and 3.8

* fixed formatting issue from rebase/conflict

* Checking against glob patterns in more performant way

* perf improvments and reverted unnecessarily adjusted tests

* added new benchmark test around filters

* no longer using get with default in entityfilter

* changed filter name and removed logbook from filter benchmark

* simplified benchmark tests from feedback

* fixed apache tests and returned include exclude schemas to normal

* fixed azure event hub tests to properly go through component logic

* fixed azure test and clean up for other tests

* renaming test files to match standard

* merged mqtt statestream test changes with base

* removed dependency on recorder filter schema from history

* fixed recorder tests after merge and a bunch of lint errors
2020-06-23 20:02:29 -05:00
J. Nick Koston 5f4fdaa171
Remove zeroconf options from homekit (#35687)
* Remove zeroconf options from homekit

homekit uses the system shared zeroconf instance which
made the interface choice option controlled by the
zeroconf integration setting.

* change to cv.deprecated

* adj

* fix remaining tests from original merge conflict

* remove invalidation_version
2020-06-02 17:47:39 -05:00
J. Nick Koston 8cbee76929
Add support for homekit camera motion notification (#35994)
* Add support for homekit camera motion notification

A motion sensor can now be linked to the cameras.

* Increase coverage
2020-05-25 18:05:38 -05:00
J. Nick Koston 4313d4b26b
Ensure homekit bridge state is restored before creating devices (#36098)
* Ensure homekit bridge state is restored before creating devices

* Tests to ensure homekit device registry entry is stable

* remove stray continue
2020-05-25 11:17:30 -05:00
J. Nick Koston b57cabfce7
Homekit should skip devices that are missing in device registry (#35857)
* Homekit should skip devices that are missing in device registry

* Add test for this failure state
2020-05-21 10:30:18 +02:00
J. Nick Koston 751529feca
Use system zeroconf singleton for homekit (#35502)
Zeroconf instances are expensive so we share a single instance
instead of running multiple.
2020-05-11 13:21:16 -05:00
J. Nick Koston 0a9b373edb
Show device details in homekit accessory service info (#35100)
* Show device info in homekit accessory service info

* fix conflict
2020-05-11 09:09:48 -05:00
stickpin a38bb5b33b
Add Homekit cameras codecs (#35238)
* Homekit cameras - Add codecs support

* Add valid_codecs + move audio application parameter

* Increase video bufsize

* Increase audio bufsize

* Update config flow to be aware of the copy option

* Add tests for copy video and audio codec

* remove unused from test

* remove unused from test

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-07 09:55:09 -05:00
Greg Thornton dd715fcc3a
Add homekit camera support (#32527)
* Add homekit camera support

* Cleanup pyhapcamera inheritance

* Add camera to homekit manifest

* Use upstream pyhap server handler in homekit

* Remove unused homekit constants

* Fix lint errors in homekit camera

* Update homekit camera log messages

* Black after conflict fixes

* More conflict fixes

* missing srtp

* Allow streaming retry when ffmpeg fails to connect

* Fix inherit of camera config, force kill ffmpeg on failure

* Fix audio (Home Assistant only comes with OPUS)

* Fix audio (Home Assistant only comes with OPUS)

* Add camera to the list of supported domains.

* add a test for camera creation

* Add a basic test (still needs more as its only at 44% cover)

* let super handle reconfigure_stream

* Remove scaling as it does not appear to be needed and causes artifacts

* Some more basic tests

* make sure no exceptions when finding the source from the entity

* make sure the bridge forwards get_snapshot

* restore full coverage to accessories.py

* revert usage of super for start/stop stream

* one more test

* more mocking

* Remove -tune zerolatency, disable reconfigure_stream

* Restore -tune zerolatency

Co-authored-by: John Carr <john.carr@unrouted.co.uk>
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-04 19:03:46 -05:00
J. Nick Koston 793592b2b8
Config flow for homekit (#34560)
* Config flow for homekit

Allows multiple homekit bridges to run

HAP-python state is now stored at .storage/homekit.{entry_id}.state
aids is now stored at .storage/homekit.{entry_id}.aids

Overcomes 150 device limit by supporting
multiple bridges.

Name and port are now automatically allocated
to avoid conflicts which was one of the main
reasons pairing failed.

YAML configuration remains available in order to offer entity
specific configuration.

Entries created by config flow can add and remove
included domains and entities without having to restart

* Fix services as there are multiple now

* migrate in executor

* drop title from strings

* Update homeassistant/components/homekit/strings.json

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Make auto_start advanced mode only, add coverage

* put back title

* more references

* delete port since manual config is no longer needed

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-30 23:05:06 -05:00
J. Nick Koston 799d98eaf0
Cleanup homekit callbacks and jobs (#34975) 2020-04-30 15:49:16 -07:00
Paulus Schoutsen ec47216388
Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
J. Nick Koston 6c3ea2a904
Fix zeroconf interface being ineffective in HomeKit (#34516) 2020-04-21 20:46:19 -07:00
J. Nick Koston 96649a7e27
Use registry to find linked batteries for homekit (#33519) 2020-04-21 17:43:49 -07:00
J. Nick Koston d06fce6997
Display Homekit QR code when pairing (#34449)
* Display a QR code for homekit pairing

This will reduce the failure rate with HomeKit
pairing because there is less chance of entry
error.

* Add coverage

* Test that the qr code is created

* I cannot spell

* Update homeassistant/components/homekit/__init__.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/homekit/__init__.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-21 17:38:43 -05:00
Paulus Schoutsen 19be31d13a
Migrate HomeKit to use describe_event for logbook support (#34485) 2020-04-20 17:48:09 -07:00
J. Nick Koston f0d553514d
Add vacuum support to homekit (#34386) 2020-04-20 08:00:52 -07:00