Lazy loading of service descriptions (#11479)

* Lazy loading of service descriptions

* Fix tests

* Load YAML in executor

* Return a copy of available services to allow mutations

* Remove lint

* Add zha/services.yaml

* Only cache descriptions for known services

* Remove lint

* Remove description loading during service registration

* Remove description parameter from async_register

* Test async_get_all_descriptions

* Remove lint

* Fix typos from multi-edit

* Remove unused arguments

* Remove unused import os

* Remove unused import os, part 2

* Remove unneeded coroutine decorator

* Only use executor for loading files

* Cleanups suggested in review

* Increase test coverage

* Fix races in existing tests
This commit is contained in:
Anders Melchiorsen 2018-01-07 23:54:16 +01:00 committed by Paulus Schoutsen
parent 3cbd77f6ac
commit 8267a21bfe
85 changed files with 253 additions and 729 deletions

View file

@ -640,10 +640,7 @@ class TestServiceRegistry(unittest.TestCase):
def test_services(self):
"""Test services."""
expected = {
'test_domain': {'test_service': {'description': '', 'fields': {}}}
}
self.assertEqual(expected, self.services.services)
assert len(self.services.services) == 1
def test_call_with_blocking_done_in_time(self):
"""Test call with blocking."""