Commit Graph

28 Commits (86d3baa34e4c296f112b4bbc9540f4b0461379aa)

Author SHA1 Message Date
J. Nick Koston 94bf55e29b
Limit concurrency of async_get_integration to avoid creating extra threads (#43085)
* Limit concurrency of async_get_integration to avoid creating extra threads

Since async_get_integration is waiting on the disk most of the time
it would end up creating many new threads because the disk could
not deliver the data in time.

* pylint
2020-11-10 21:34:54 -10:00
J. Nick Koston c7f35b20fb
Make all translations cacheable (#42892) 2020-11-09 22:36:45 +01:00
J. Nick Koston 5ca4b4cd0f
Set the translations cache under the lock (#42470) 2020-10-27 22:02:38 +01:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Joakim Sørensen 835f433cf7
Remove loading of legacy translations (#37021) 2020-06-23 10:58:11 +02:00
Paulus Schoutsen b3201523aa
Fix translation merging for custom components without translations (#35032) 2020-05-01 11:34:09 -07: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
Joakim Sørensen 730a257f3c
Rename translations dir for integrations (#34494) 2020-04-21 16:11:05 -07:00
Paulus Schoutsen 4720a7a891
Add foundation for state translations (#34443) 2020-04-19 20:35:49 -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
Paulus Schoutsen 94a3cec4bf
Take integration title from manifest if not translated (#34283) 2020-04-16 08:38:54 -07: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
Bas Nijholt 67c56c860d Sort imports according to PEP8 for 'homeassistant' folder (#29789)
Components are already done
2019-12-09 16:42:10 +01:00
Franck Nijhof 2f0eb07624 Migrate legacy typehints in core to PEP-526 (#26403)
* Migrate legacy typehints in core to PEP-526

* Fix one type
2019-09-03 20:36:04 -07:00
Franck Nijhof decf13b948 Use literal string interpolation in core (f-strings) (#26166) 2019-08-23 09:53:33 -07:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Joakim Plate 2fbbcafaed
Support config flow on custom components (#24946)
* Support populating list of flows from custom components

* Re-allow custom component config flows

* Add tests for custom component retrieval

* Don't crash view if no handler exist

* Use get_custom_components instead fo resolve_from_root

* Switch to using an event instead of lock

* Leave list of integrations as set

* The returned list is not guaranteed to be ordered

Backend uses a set to represent them.
2019-07-09 01:19:37 +02:00
Paulus Schoutsen 1e22c8daca
Automatically generate config flow list (#23802)
* Add config flow to manifest.json

* Still load config flows via config flow platform

* Fix typo

* Lint

* Update config_flows.py"

* Catch import error when setting up entry

* Lint

* Fix tests

* Fix imports

* Lint

* Fix Unifi tests

* Fix translation test

* Add homekit_controller config flow
2019-05-13 01:16:55 -07:00
Paulus Schoutsen fda483f482
Don't load component when fetching translations (#23196) 2019-04-18 11:11:43 -07:00
Paulus Schoutsen 3f69d0283d
Convert translation helper to use async_get_integration (#23054)
* Convert translation helper to use async_get_integration

* Simplify after comments

* Lint

* Fix typing

* Typo
2019-04-12 17:10:19 -07:00
uchagani c5f4aa0466 show which component is causing translation errors (#22340) 2019-03-23 23:06:55 -07:00
Paulus Schoutsen 9fd21d20ae
Fix loading translations for embedded platforms (#20122)
* Fix loading translations for embedded platforms

* Update doc string

* Lint
2019-01-15 16:06:04 -08:00
Ville Skyttä c9c707e368
Start type annotating/testing helpers (#17858)
* Add type hints to helpers.intent and location

* Test typing for helpers.icon, json, and typing

* Add type hints to helpers.state

* Add type hints to helpers.translation
2018-10-28 21:12:52 +02:00
Ville Skyttä 6f582dcf24 Lint cleanups (#15243)
* Remove some unused imports

* Fix a flake8 E271
2018-07-01 11:57:01 -04:00
Paulus Schoutsen 83d300fd11 Custom component loading cleanup (#14211)
* Clean up custom component loading

* Fix some tests

* Fix some stuff

* Make imports work again

* Fix tests

* Remove debug print

* Lint
2018-05-01 20:57:30 +02:00
Paulus Schoutsen fb1fafefab
Include all config flow translations with backend translations (#13394) 2018-03-22 12:21:33 -07:00
Adam Mills b434ffba2d Support serving of backend translations (#12453)
* Add view to support backend translation fetching

* Load backend translations from component json

* Translations for season sensor

* Scripts to merge and unpack Lokalise translations

* Fix copy paste error

* Serve post-lokalise translations to frontend

* Linting

* Auto-deploy translations with Travis

* Commit post-lokalise translation files

* Split logic into more helper functions

* Fall back to English for missing keys

* Move local translation copies to `.translations`

* Linting

* Initial tests

* Remove unnecessary file check

* Convert translation helper to async/await

* Convert translation helper tests to async/await

* Use set subtraction to find missing_components

* load_translation_files use component->file mapping

* Remove duplicated resources fetching

Get to take advantage of the slick Python 3.5 dict merging here.

* Switch to live project ID
2018-02-28 19:31:38 -08:00