Commit graph

1879 commits

Author SHA1 Message Date
Paulus Schoutsen
b90cb09fd1
Add type to device registry (#35095) 2020-05-03 13:56:58 -07:00
Ville Skyttä
752679c55d
Check isinstance on collections.abc, not typing classes (#35087) 2020-05-02 23:57:48 +02:00
Paulus Schoutsen
b3201523aa
Fix translation merging for custom components without translations (#35032) 2020-05-01 11:34:09 -07:00
Paulus Schoutsen
8f9467492d
Remove some passings of loop (#34995) 2020-04-30 21:34:51 -07: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
Paulus Schoutsen
6056753a9c
Introduce a singleton decorator (#34803) 2020-04-30 16:47:14 -07:00
Franck Nijhof
928d9ec117
Fix not condition validation and entity/device extraction (#34959) 2020-05-01 00:15:53 +02:00
J. Nick Koston
13f4393042
Fix flapping reload tests (#34837) 2020-04-28 22:58:55 -07:00
Paulus Schoutsen
87801d8aca
Minor helpers cleanup (#34786) 2020-04-28 14:31:25 -07:00
Paulus Schoutsen
28f6e79385
Parallelize collections helper (#34783) 2020-04-28 14:31:16 -07:00
Paulus Schoutsen
cc14dfa31c
Allow ignoring discovery config flow helper (#34740) 2020-04-26 23:35:04 -07:00
Franck Nijhof
c93c6a66e8
Add NOT condition helper (#34624) 2020-04-24 09:40:23 -07:00
Paulus Schoutsen
6404882ec4
Allow flows to know if user is in advanced mode (#34629) 2020-04-24 09:31:56 -07:00
Paulus Schoutsen
d3bbd9ec65
Delay sync for Google and limit updates to relevant info (#34622) 2020-04-24 10:49:11 +02:00
Paulus Schoutsen
e9ff1940d6
Translation fixes and tweaks (#34489)
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
2020-04-21 17:57:21 -07:00
J. Nick Koston
96649a7e27
Use registry to find linked batteries for homekit (#33519) 2020-04-21 17:43:49 -07:00
Joakim Sørensen
730a257f3c
Rename translations dir for integrations (#34494) 2020-04-21 16:11:05 -07:00
Martin Hjelmare
fbde040f59
Complete device registry update (#34500)
* Add manufacturer and model parameters to device registry update
  method.
2020-04-21 19:40:16 +02:00
Franck Nijhof
bc5a2da7b7
Add transition support to scenes, cleanup blocking parameter (#34434) 2020-04-20 18:07:50 -07:00
Mikael Svensson
ccc818266b
Fix relative_time datetime object without timezone (#34273) 2020-04-20 10:29:12 -07:00
Paulus Schoutsen
4720a7a891
Add foundation for state translations (#34443) 2020-04-19 20:35:49 -07:00
J. Nick Koston
0abcf2d176
Optimize async_generate_entity_id (#34440) 2020-04-19 18:19:11 -05:00
Paulus Schoutsen
26f78132ae
Fix circular import (#34441) 2020-04-19 14:41:52 -07:00
Paulus Schoutsen
d10f5a48d4
Fix translations merging (#34417)
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
2020-04-19 12:37:44 -07:00
Paulus Schoutsen
98f1548f2d
Allow fetching translations by categories (#34329) 2020-04-18 17:13:13 -07:00
Ville Skyttä
267d98b5eb
Type hint improvements (#33082) 2020-04-17 11:33:58 -07:00
Paulus Schoutsen
ff469cb592
Update Coordinator: Only schedule a refresh if listenerrs (#34317) 2020-04-16 16:44:14 -07:00
Paulus Schoutsen
94a3cec4bf
Take integration title from manifest if not translated (#34283) 2020-04-16 08:38:54 -07:00
Paulus Schoutsen
5a9970e63c
Dump states in event handler for HA_Stop (#33974)
* Dump states in event handler for HA_Stop

* Fix type
2020-04-13 17:41:01 -07:00
Franck Nijhof
6d24a65313
Various light test improvements (#34131) 2020-04-13 15:33:04 +02:00
springstan
00b6409b76
Use LENGTH_METERS constant (#34110) 2020-04-12 21:44:56 +02:00
Ville Skyttä
9b7e31eca3
Make f-strings without placeholder normal strings (#33938) 2020-04-10 09:59:06 +02:00
springstan
9a40d5b7ed
Use HTTP_NOT_FOUND constant (#33835) 2020-04-09 00:57:47 +02:00
springstan
fca90a8ddc
Improve string formatting v5 (#33697)
* Improve string formatting v5

* Address review comments
2020-04-05 17:48:55 +02:00
Franck Nijhof
7d3c974747
Use set & dict literals (#33636)
Co-authored-by: Daniel Høyer Iversen <mail@dahoiv.net>
2020-04-04 20:05:15 +02:00
Franck Nijhof
b9b1cee403
Enable pylint import-outside-toplevel (#33631) 2020-04-04 17:07:36 +02:00
Paulus Schoutsen
dc7127aacf
Data Coordinator to return unsub func (#33588) 2020-04-03 20:15:42 +02:00
Paulus Schoutsen
aef06a3544
Directly call write state 2 (#33513)
* Directly call async_write_ha_state pt2

* Directly call async_write_ha_state pt2

* Fix mock

* Address comments
2020-04-03 09:34:50 +02:00
David F. Mulcahey
8b0a0ee521
Don't write storage to disk while stopping (#33456)
* Don't write storage to disk while stopping

* rework change

* lint

* remove delay save and schedule final write at stop

* update tests

* fix test component using private methods

* cleanup

* always listen

* use stop in restore state again

* whitelist JSON exceptions for later

* review comment

* make zwave tests use mock storage
2020-04-02 10:25:28 -07:00
Ziv
4dbbf93af9
Replace asyncio.wait with asyncio.gather since wait ignores exceptions (#33380)
* replace asyncio.wait with asyncio.gather since wait ignores exceptions
fix for test_entity_platform so it expects the exception

* changed to log on failed domains

* discovered that this fix actually removes other uncaught exceptions

* fix in the list of ignored exceptions

* replaced a few ignores on dyson tests that work locally but fail in the CI

* two more tests that are failing on the CI and not locally

* removed assertion on multiple entries with same unique_id - replaced with log and return
reverted test_entity_platform to its original since now there is no exception thrown

* entered all the dyson tests. they all pass locally and probabilistically fail in the CI

* removed unnecessary str() for exception

* added log message for duplicate entity_id / unique_id

* removed log in case of False return value

* added exc_info

* change the use of exc_info
2020-04-01 07:09:13 -07:00
David F. Mulcahey
bcd1eb952c
RFC - Add a 3rd state to the HA shutdown sequence for writing… (#33358)
* add third stage to hass shutdown

* use 3rd stage in storage

* update core state

* add writing data to multi stop ignore

* update core test

* review comment

* update name based on feedback
2020-03-30 10:18:39 -07:00
Paulus Schoutsen
73c52e668e
Fix dispatcher logging (#33299) 2020-03-26 20:44:44 -07:00
Erik Montnemery
867630a4a7
Remove state when entity is removed from registry (#32184) 2020-03-26 16:33:50 -07:00
Fabian Affolter
2647296475
Refactor API documentation (#33217)
* Upgrade Sphinx to 2.4.4

* Refactor API documentation

* Remove left-over

* Remove Markdown from docstring

* Update titels
2020-03-25 13:21:04 -07:00
Eugenio Panadero
fb22f6c301
Add Context support for async_entity removal (#33209)
* Add Context for async_remove

* Check context in state automation on entity removal
2020-03-24 09:59:17 -07:00
Eugenio Panadero
cd57b764ce
Fix state_automation_listener when new state is None (#32985)
* Fix state_automation_listener when new state is None (fix #32984)

* Listen to EVENT_STATE_CHANGED instead of using async_track_state_change

and use the event context on automation trigger.

* Share `process_state_match` with helpers/event

* Add test for state change automation on entity removal
2020-03-23 16:05:21 -07:00
Paulus Schoutsen
1ff245d9c2
Make sure entity platform services work for all platforms of d… (#33176)
* Make sure entity platform services work for all platforms of domain

* Register a bad service handler

* Fix cleaning up

* Tiny cleanup
2020-03-23 12:59:36 -07:00
Paulus Schoutsen
f95c3e265d
Fix script logging with name (#33120) 2020-03-22 13:29:50 +01:00
Eugenio Panadero
d5e606640c
Fix scheduled update time-drift in data update coordinator (#32974)
* Fix scheduled update time-drift in data update coordinator

As next schedule is calculated **after** the update is done,
setting now + update_interval makes 1 second drift in practice,
as the tick is 1Hz.

* Floor the utcnow timestamp

to remove sub-second error precision, and generate constant frequency updates
as long as the update takes < 1s.
2020-03-21 16:57:12 -07:00
Ville Skyttä
05abf37046
Type hint improvements (#32905)
* Complete helpers.entity_component type hints

* Add discovery info type
2020-03-18 19:27:25 +02:00