Commit Graph

45 Commits (15348965f311d07ec5f374c37f41eea9be596b28)

Author SHA1 Message Date
Jan Bouwhuis cfc8b5fee7
Fix notify discovery setup (#68451)
* Fix notify discovery setup

* add test

* unsubscribe at reset

* Add guard

* move dispatcher to reload module

* only unsubscribe if platform was setup

* initialize dispatcher once and tests

* test get_service too

* add tests

* fix test

* use get_service for test invalid platform

* Test built-in reload method

* set to None after clearing dispatcher - tests

* Pathing services file

* Update tests/components/notify/test_init.py

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

* dispatcher is not set twice if integration loaded

* empty discovery payload

* Removed not needed services.yaml mock

* Update tests/components/notify/test_init.py

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

* flake8

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-03-28 08:53:30 +02:00
epenet 0a7b1dec7d
Adjust type hint in core add_job (#66503)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-02-14 11:13:10 +01:00
epenet 128256a3ee
Fix invalid type hint in discovery async_listen (#63987)
* Fix invalid type hint in discovery async_listen

* Add setup type hints to sabnzbd

Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-13 02:43:43 +01:00
Marc Mueller 240c9979c7
Move `disallow-any-generics` to mypy.ini (#63917) 2022-01-11 13:33:25 -08:00
epenet 51292cc135
Fix incorrect type hint in discovery helper (#63789)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-10 11:14:31 +01:00
epenet 665eeb4b27
Explicitely allow Platform enum in discovery helper (#63571)
* Adjust Platform type hint in discovery helper

* Adjust amcrest

* Adjust comfoconnect

* Adjust ecovacs

* Adjust egardia

* Rename arguments

* Convert Platform enum to string explicitely

* Revert "Adjust egardia"

This reverts commit ff7b0d6100.

* Revert "Adjust ecovacs"

This reverts commit 2749045e13.

* Revert "Adjust comfoconnect"

This reverts commit bfff08f7fc.

* Undo argument name change and conversion to string

* Remove comment

Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-09 06:06:56 +01:00
Marc Mueller 238b488642
Use assignment expressions 03 (#57710) 2021-10-17 20:08:11 +02:00
Marc Mueller 77ee72cbb9
Import Callable from collections.abc (1) (#56775) 2021-09-29 16:32:11 +02:00
Marc Mueller 6fb2e63e49
Update typing 02 (#48014) 2021-03-17 18:34:19 +01:00
Paulus Schoutsen 557ec374f1
Convert discovery helper to use dispatcher (#47008) 2021-02-24 13:37:31 -08:00
Ville Skyttä 82607977ef
Various type hint improvements (#46144) 2021-02-08 11:59:46 +01:00
Paulus Schoutsen 5b6d9abe2a
Await callbacks to keep cleaner stacktraces (#43693) 2020-11-27 17:48:43 +01:00
J. Nick Koston 852d1b2e67
Update discovery to use HassJob (#41511)
Predetermine the listener types for discovery
2020-10-09 09:35:28 +02:00
Paulus Schoutsen 8f3c84b349
Mark config dependency of frontend (#36587) 2020-06-09 23:27:47 -07:00
Ville Skyttä 267d98b5eb
Type hint improvements (#33082) 2020-04-17 11:33:58 -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
Ville Skyttä fa4fa30461 Various string cleanups (#30435)
* 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ä 6604680793
Helpers type hint improvements (#30106) 2019-12-21 09:23:48 +02:00
Bas Nijholt 67c56c860d Sort imports according to PEP8 for 'homeassistant' folder (#29789)
Components are already done
2019-12-09 16:42:10 +01:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Ville Skyttä d64f1e767c Type check all helpers (#25373)
* 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 6b0180f753
Fix demo (#23087)
* Fix demo

* Fix types

* Fix all the things

* Fix type

* Fix test

* Lint
2019-04-14 16:59:06 -07:00
Matthias Urlichs b506aafbb4 docstring fix (#18257) 2018-11-06 12:41:15 +01:00
Paulus Schoutsen 6ae345b01c
Pass hass_config to load_platform (#17952)
* Pass hass_config to load_platform

* Fix tests

* Lint
2018-10-29 19:21:21 +01:00
Ville Skyttä dbd0763f83 Grammar and spelling fixes (#16065) 2018-08-19 22:29:08 +02:00
Paulus Schoutsen ea2ff6aae3
Use async_create_task (#15633)
* Use async_create_task

* Fix test
2018-07-23 14:05:38 +02:00
Paulus Schoutsen 5a9013cda5
Refactor Hue: phue -> aiohue (#13043)
* phue -> aiohue

* Clean up

* Fix config

* Address comments

* Typo

* Fix rebase error

* Mark light as unavailable when bridge is disconnected

* Tests

* Make Throttle work with double delay and async

* Rework update logic

* Don't resolve host to IP

* Clarify comment

* No longer do unnecessary updates

* Add more doc

* Another comment update

* Wrap up tests

* Lint

* Fix tests

* PyLint does not like mix 'n match async and coroutine

* Lint

* Update aiohue to 1.2

* Lint

* Fix await MagicMock
2018-03-16 20:27:05 -07:00
Matthias Urlichs f5cc40024d Rename homeassistant.util.async to .async_ (#13088)
"async" is (going to be) a reserved word.
2018-03-11 10:01:12 -07:00
Eitan Mosenkis 95cd2035b6 Fix incorrect comment. (#11111) 2017-12-13 00:04:42 +01:00
Paulus Schoutsen ca54bbfcc9 RFC: Use bind_hass for helpers (#9745)
* Add Helpers bind_hass functionality

* Update other helpers
2017-10-08 08:17:54 -07:00
Fabian Affolter 0863d50210 Fix typos (#7957)
Add an optional extended description…
2017-06-08 15:53:12 +02:00
Fabian Affolter a4f1f6e724 Update docstrings (#7374)
* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstring

* Update docstrings

* Update docstrings

* Fix lint issues

* Update docstrings

* Revert changes in dict
2017-05-02 09:18:47 -07:00
Paulus Schoutsen 2650c73a89 Split bootstrap into bs + setup (#6416)
* Split bootstrap into bs + setup

* Lint
2017-03-05 10:41:54 +01:00
Pascal Vizeli 41f558b181 Bootstrap / Component setup async (#6264)
* Bootstrap / Entiy setup async

* Cleanup add_job stuff / return task/future object

* Address paulus comments / part 1

* fix install pip

* Cleanup bootstrap / move config stuff to config.py

* Make demo async

* Further bootstrap improvement

* Address Martin's comments

* Fix initial tests

* Fix final tests

* Fix bug with prepare loader

* Remove no longer needed things

* Log error when invalid config

* More cleanup

* Cleanups platform events & fix lint

* Use a non blocking add_entities callback for platform

* Fix Autoamtion is setup befor entity is ready

* Better automation fix

* Address paulus comments

* Typo

* fix lint

* rename functions

* fix tests

* fix test

* change exceptions

* fix spell
2017-02-28 20:33:19 -08:00
Paulus Schoutsen f29ee24b72 Do not allow config dependency (#6036)
* Do not allow config dependency

* Prevent config in discovery

* Migrate to blacklist
2017-02-18 11:31:37 -08:00
Paulus Schoutsen c81735cc84 Fix platform discovery when platform discovered during discovery of a (#4529)
component
2016-11-22 08:21:08 -08:00
Pascal Vizeli 835577b2bc Bugfix discovery use wrong time async (#4515)
* Bugfix discovery use wrong time async

* fix lint
2016-11-21 19:33:08 -08:00
Paulus Schoutsen 455e1df7cb Fix typo 2016-11-19 16:05:33 -08:00
Paulus Schoutsen d930c399fe Better locking while setting up components + discovery (#4463) 2016-11-19 08:18:33 -08:00
Pascal Vizeli c56f99baaf Async migration device_tracker (#4406)
* Async migration device_tracker

* change location stuff to async

* address paulus comments

* fix lint & add async discovery listener

* address paulus comments v2

* fix tests

* fix test_mqtt

* fix test_init

* fix gps_acc

* fix lint

* change async_update_stale to callback
2016-11-18 23:35:08 +01:00
Paulus Schoutsen 4163e55dbd Introducing hass.data (#4121)
* Hello hass.data

* Migrate setup_component to hass.data
2016-10-29 14:51:17 -07:00
Paulus Schoutsen 9ea1101aba Fix bootstrap circular imports (#4108)
* Fix bootstrap circular imports

* fix test

* Lint
2016-10-29 12:54:47 -07:00
Pascal Vizeli 0b8b9ecb94 Async EntitiesComponent (#3820)
* first version

* First draft component entities

* Change add_entities to callback from coroutine

* Fix bug add async_prepare_reload

* Group draft v1

* group async

* bugfix

* bugfix v2

* fix lint

* fix extract_entity_ids

* fix other things

* move get_component out of executor

* bugfix

* Address minor changes

* lint

* bugfix - should work now

* make group init async only

* change update handling to old stuff

* fix group handling, remove generator from init

* fix lint

* protect loop for spaming with updates

* fix lint

* update test_group

* fix

* update group handling

* fix __init__ async trouble

* move device_tracker to new layout

* lint

* fix group unittest

* Test with coroutine

* fix bug

* now it works 💯

* ups

* first part of suggestion

* add_entities to coroutine

* change group

* convert add async_add_entity to coroutine

* fix unit tests

* fix lint

* fix lint part 2

* fix wrong import delete

* change async_update_tracked_entity_ids to coroutine

* fix

* revert last change

* fix unittest entity id

* fix unittest

* fix unittest

* fix unittest entity_component

* fix group

* fix group_test

* try part 2 to fix test_group

* fix all entity_component

* rename _process_config

* Change Group to init with factory

* fix lint

* fix lint

* fix callback

* Tweak entity component and group

* More fixes

* Final fixes

* No longer needed blocks

* Address @bbangert comments

* Add test for group.stop

* More callbacks for automation
2016-10-16 09:35:46 -07:00
Paulus Schoutsen f1632496f0 Allow circular dependency with discovery (#2616) 2016-07-25 22:49:10 -07:00
Paulus Schoutsen 30f74bb3ca Migrate to generic discovery method (#2271)
* Migrate to generic discovery method

* Add tests for discovery
2016-06-11 17:43:13 -07:00