Commit graph

81 commits

Author SHA1 Message Date
Erik Montnemery
12a6d10168
Log exceptions in EntityPlatform.async_add_entities ()
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-13 15:35:27 +02:00
Ville Skyttä
f28c3273c2
Upgrade mypy to 0.790 () 2020-10-12 19:17:30 -05:00
Ville Skyttä
167490b71c
Complete helpers.service type hints ()
* Complete helpers.service type hints

* Update homeassistant/helpers/service.py

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

* Handle None entity.supported_features
2020-09-20 12:03:58 +03:00
J. Nick Koston
8adfcf23f0
Fix isy994 send_node_command () 2020-09-08 17:31:08 +02:00
Franck Nijhof
1c2ebdf307
Upgrade black to 20.8b1 () 2020-08-27 13:56:20 +02:00
Paulus Schoutsen
3dc79aa60a
Track entity sources ()
Co-authored-by: David Mulcahey <david.mulcahey@me.com>
2020-08-19 14:57:38 +02:00
J. Nick Koston
af5cb948a0
Adjust slow add entities timeouts to handle slowest known case ()
With this change, we should still be able to startup
in under 10 minutes if something really goes wrong.

The testing done in  was used to determine
these values.
2020-08-15 07:14:02 +02:00
Paulus Schoutsen
b3571602bb
Add default_* to device registry () 2020-08-13 10:38:56 +02:00
Ville Skyttä
991bf126d4
Helpers type hint improvements () 2020-08-12 23:01:10 +02:00
Pascal Vizeli
72a6251042
V2 timeout for async_add_entities ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-08-07 08:36:38 +02:00
Pascal Vizeli
896bdbff8f
Revert "Add a timeout for async_add_entities ()" ()
This reverts commit 7590af3930.
2020-08-06 09:32:42 +02:00
J. Nick Koston
7590af3930
Add a timeout for async_add_entities () 2020-08-05 18:06:21 +02:00
Pascal Vizeli
c291d4aa7d
Intelligent timeout handler for setup/bootstrap ()
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-05 14:58:19 +02:00
J. Nick Koston
fe69a85386
Improve logging when a unique id conflict is detected ()
* fix error when unique id is re-used

* add test for the logging

* Update homeassistant/helpers/entity_platform.py

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

* Update homeassistant/helpers/entity_platform.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-08-01 11:20:37 +02:00
David F. Mulcahey
967a168ab7
Update comment about parallel updates to match the documentation () 2020-07-19 14:40:08 -10:00
Paulus Schoutsen
d08d00daa7
Limit entity platform entity service to same integration () 2020-07-02 11:39:53 +02:00
mdegat01
52f3238e17
Add constant for PlatformNotReady wait time to use in tests () 2020-07-01 08:42:57 -07:00
Paulus Schoutsen
1ffa8fcbba
Platforms cleanup when adding entity fails () 2020-06-12 17:54:46 -07:00
Ville Skyttä
0c5ca3084e
Add and fix type hints ()
* Fix exceptions.Unauthorized.permission type

* Use auth.permission consts more

* Auth typing improvements

* Helpers typing improvements

* Calculate self.state only once
2020-06-06 20:34:56 +02:00
Paulus Schoutsen
276f3afb00
Do async_setup_platform in background ()
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-31 22:18:30 -07:00
Paulus Schoutsen
b90cb09fd1
Add type to device registry () 2020-05-03 13:56:58 -07:00
Paulus Schoutsen
5a9970e63c
Dump states in event handler for HA_Stop ()
* Dump states in event handler for HA_Stop

* Fix type
2020-04-13 17:41:01 -07:00
Paulus Schoutsen
aef06a3544
Directly call write state 2 ()
* 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
Ziv
4dbbf93af9
Replace asyncio.wait with asyncio.gather since wait ignores exceptions ()
* 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
Paulus Schoutsen
1ff245d9c2
Make sure entity platform services work for all platforms of d… ()
* 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
Ville Skyttä
05abf37046
Type hint improvements ()
* Complete helpers.entity_component type hints

* Add discovery info type
2020-03-18 19:27:25 +02:00
Paulus Schoutsen
51c35ab9a8
Entity Registry to store and restore name/icon ()
* Entity Registry to store and restore name/icon

* Update test_entity_registry.py

* Add original name/icon to JSON result
2020-02-11 09:40:50 -08:00
Paulus Schoutsen
e970177eeb
Use entity.async_request_call in service helper ()
* Use entity.async_request_call in service helper

* Clean up semaphore handling

* Address comments

* Simplify call entity service helper

* Fix stupid rflink test
2020-02-04 15:30:15 -08:00
Paulus Schoutsen
0c3ffbe282
Add foundation for integration services ()
* Add foundation for integration services

* Fix tests

* Remove async_get_platform

* Migrate Sonos partially to EntityPlatform.async_register_entity_service

* Tweaks

* Move other Sonos services to media player domain

* Move other Sonos services to media player domain

* Address comments

* Remove lock

* Fix typos

* Use make_entity_service_schema

* Add area extraction to async_extract_entities

Co-authored-by: Anders Melchiorsen <amelchio@nogoto.net>
2020-01-19 17:55:18 -08:00
Jc2k
de26108b23 Restore unit_of_measurement from entity registry ()
* Restore unit_of_measurement from entity registry

* Lint fix
2020-01-15 08:09:05 -08:00
Paulus Schoutsen
c4673ddee1
Update Ring to 0.6.0 ()
* Update Ring to 0.6.0

* Update sensor tests

* update -> async_update

* Delete temp files

* Address comments

* Final tweaks

* Remove stale print
2020-01-14 12:54:45 -08:00
Paulus Schoutsen
abe727fbbc
Log error when integration is missing platform setup () 2020-01-11 18:21:57 -08:00
Paulus Schoutsen
9aa02e35a7
Entity Component to no longer generate automatic groups () 2020-01-07 17:30:53 +01:00
Ville Skyttä
fa4fa30461 Various string cleanups ()
* Remove some unnecessary string concatenations

* Replace some simple str.formats with f-strings

* Replace some string concatenations with f-strings
2020-01-03 14:47:06 +01:00
Ville Skyttä
e6388e186c
Remove unnecessary string literal concatenations () 2020-01-02 21:17:10 +02:00
Paulus Schoutsen
bb14a083f0
Store capabilities and supported features in entity registry, restore registered entities on startup ()
* Store capabilities and supported features in entity registry

* Restore states at startup

* Restore non-disabled entities on HA start

* Fix test

* Pass device class from entity platform

* Clean up restored entities from state machine

* Fix Z-Wave test?
2019-12-31 14:29:43 +01:00
Ville Skyttä
6604680793
Helpers type hint improvements () 2019-12-21 09:23:48 +02:00
Bas Nijholt
67c56c860d Sort imports according to PEP8 for 'homeassistant' folder ()
Components are already done
2019-12-09 16:42:10 +01:00
Bas Nijholt
3ce850234f fix typo in comments ()
The global is called `PARALLEL_UPDATES` not `PARALLEL_UPDATE`.
2019-11-11 13:51:26 +01:00
Pascal Vizeli
c1851a2d94
Cleanup coroutine threadsafe ()
* Cleanup coroutine threadsafe

* fix lint

* Fix typing

* Fix tests

* Fix black
2019-10-01 16:59:06 +02:00
Franck Nijhof
decf13b948 Use literal string interpolation in core (f-strings) () 2019-08-23 09:53:33 -07:00
Paulus Schoutsen
aa56b4dd30
Log warning if disabled entities receive updates. ()
* Log warning if disabled entities receive updates.

* Fix test

* Always set entity ID on disabled entities
2019-08-22 14:12:24 -07:00
Robert Svensson
a2589f56e1 Add system options to config entries ()
* Add system options to config entries

* For feedback

* Follow most of balloobs comments

* Fix balloobs comments

* Improvements

* Fix second round of Balloobs comments

* Fix third round

* Add system options to mock config entry

* Fix integration tests

* Fix the last failing tests

* Fix disabled string

* Fix failing disabled_by tests

* New tests

* Config entry WS API tests

* Fix comments
2019-08-17 21:34:11 -07:00
Paulus Schoutsen
6c292846be
Allow entities to indicate they should be disabled by default () 2019-08-16 16:17:16 -07:00
Paulus Schoutsen
7a90808e52 Add service to reload scenes from configuration.yaml ()
* Allow reloading scenes

* Update requirements

* address comments

* fix typing

* fix tests

* Update homeassistant/components/homeassistant/scene.py

Co-Authored-By: Martin Hjelmare <marhje52@kth.se>

* Address comments
2019-08-05 23:04:19 +02:00
Paulus Schoutsen
4de97abc3a Black 2019-07-31 12:25:30 -07:00
Ville Skyttä
d64f1e767c Type check all helpers ()
* Type check all helpers, add inline exclusions for work in progress

* Remove unused Script._template_cache

* Add some missing type hints

* Remove unneeded type: ignore

* Type hint fixes

* Mypy assistance tweaks

* Don't look for None in deprecated config "at most once" check

* Avoid None name slugify attempt when generating entity id

* Avoid None state store attempt on entity remove
2019-07-21 09:59:02 -07:00
Paulus Schoutsen
06af6f19a3
Entity to handle updates via events ()
* Entity to handle updates via events

* Fix a bug

* Update entity.py
2019-06-26 09:22:51 -07:00
Penny Wood
84e6813779 Rename via_hub to via_device ()
* Rename via_hub to via_device

* Fixed registry interactions
2019-06-10 09:10:44 -07:00
Paulus Schoutsen
440e4289e4
Instantiate lock inside event loop () 2019-05-31 11:26:05 -07:00