Commit Graph

292 Commits (172778053c84f3af4e47091585923f0de1b3f7aa)

Author SHA1 Message Date
Erik Montnemery e87ebbef01
Improve errors for component configuration with multiple errors (#103969)
* Improve errors for component configuration with multiple errors

* Suffix with link to documentation
2023-11-14 21:50:54 +01:00
Erik Montnemery 2d39eaf0a2
Improve docstring of config.stringify_invalid (#103965) 2023-11-14 14:05:46 +01:00
Erik Montnemery 94a2087ba0
Improve formatting of config validation errors (#103957)
* Improve formatting of config validation errors

* Address review comments
2023-11-14 12:48:45 +01:00
Erik Montnemery dedd3418a1
Improve print of line numbers when there are configuration errors (#103216)
* Improve print of line numbers when there are configuration errors

* Update alarm_control_panel test
2023-11-14 08:21:36 +01:00
Erik Montnemery 07af073735
Remove trailing space from configuration error messages (#103909)
* Remove trailing space from configuration error messages

* Update test
2023-11-13 15:19:37 +01:00
Erik Montnemery 6303366cf4
Tweak config._recursive_merge (#103850) 2023-11-12 19:06:12 +01:00
Erik Montnemery 97cc05d0b4
Make it possible to restart core in safe mode (#102606) 2023-10-24 14:47:58 +02:00
SmashedFrenzy16 3018d4edb9
Update config.py with f string (#101333)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-10-07 13:37:19 +02:00
Erik Montnemery cab30085c5
Fix typo in config.py (#101268) 2023-10-02 15:57:04 +02:00
Ville Skyttä 6399d74c15
Remove unnnecessary pylint configs from core (#98704) 2023-08-22 23:12:12 +02:00
Erik Montnemery 91faa53843
Don't allow hass.config.config_dir to be None (#98442) 2023-08-16 13:00:14 +02:00
Martin Hjelmare 4d2fa5bdbc
Onboard Google Translate (#95352) 2023-06-27 13:12:25 +02:00
c0ffeeca7 c3a3ddcfa4
Standardize spelling of TTS and STT (#93857)
* Standardize spelling of TTS and STT

* Apply suggestions from code review

* Update homeassistant/components/tts/media_source.py

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2023-05-31 11:00:19 -04:00
epenet 611d4135fd
Add ComponentProtocol to improve type checking (#90586) 2023-03-31 14:19:58 -04:00
Franck Nijhof 73c4ac53d2
Enable T20 (flake8-print) to ban use of print statements (#86525)
* Enable T20 (flake8-print) to ban use of print statements

* Make compatible with flake8 config
2023-01-24 14:24:21 +01:00
Franck Nijhof 79b52a2b41
Stricter pylint message control (#86154) 2023-01-20 13:47:55 +01:00
Franck Nijhof 64c2340fab
Core code styling improvements (#85963) 2023-01-15 23:00:51 +01:00
Franck Nijhof b0cee0bc46
String formatting and max line length - Part 1 (#84390)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-12-22 10:12:50 +01:00
Erik Montnemery 67e4f2c202
Raise repairs issue if country is not configured (#82685) 2022-11-28 09:54:13 +01:00
Erik Montnemery e1338adf1a
Allow configuring country and language in core config (#81734)
* Allow configuring country and language in core config

* Add script for updating list of countries

* Use black for formatting

* Fix quoting

* Move country codes to a separate file

* Address review comments

* Add generated/countries.py

* Get default language from owner account

* Remove unused variable

* Add script to generate list of supported languages

* Add tests

* Fix stale docsring

* Use format_python_namespace

* Correct async_user_store

* Improve typing

* Fix with_store decorator

* Initialize language in core store migration

* Fix startup

* Tweak

* Apply suggestions from code review

Co-authored-by: Franck Nijhof <git@frenck.dev>

* Update storage.py

Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-11-24 23:25:50 +01:00
Aarni Koskela 8038485ca4
Use partition instead of split where possible in core (#81806) 2022-11-15 21:45:48 +01:00
Erik Montnemery a2da1c7db5
Create repairs issue if an outdated currency code is configured in core store (#81772)
* Create repairs issue if an outdated currency code is configured in core store

* Update homeassistant/config.py

Co-authored-by: Aarni Koskela <akx@iki.fi>

Co-authored-by: Aarni Koskela <akx@iki.fi>
2022-11-10 17:28:19 +01:00
Erik Montnemery c3d4a9cd99
Create repairs issue if an outdated currency code is configured (#81717)
* Create repairs issue if an outdated currency code is configured

* Add script for updating list of currencies

* Use black for formatting

* Move currency codes to a separate file

* Address review comments
2022-11-08 07:21:09 +01:00
Franck Nijhof 398d18eeee
Load themes from themes folder by default (#80937) 2022-10-25 12:10:40 +02:00
epenet bff5d1123f
Deprecate CONF_UNIT_SYSTEM_*** constants (#80320)
* Deprecate CONF_UNIT_SYSTEM_*** constants

* Adjust pylint plugin

* Add tests

* Remove single-use function

* Revert logic change

* Revert "Revert logic change"

This reverts commit 60959a0050.

* Tweak again
2022-10-14 16:50:04 +02:00
epenet 8dc3ff72c6
Cleanup config deprecation warning (#80251) 2022-10-14 13:03:17 +02:00
Marc Mueller 4e5b5dfb93
Update pyupgrade to 3.1.0 (#80058)
* Update pyupgrade to 3.1.0

* Remove redundant open modes - text is the default
2022-10-11 09:04:52 +02:00
Marc Mueller af7df260a0
Fix small type issues [core] (#75760) 2022-07-26 16:28:22 +02:00
Kuba Wolanin d8ee9c1922
Add Show logs URL to integration errors notification (#71142) 2022-05-01 16:14:30 -07:00
Will Marler 79080f5e2f
Adjust "default_config" comment in default config (#68679)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2022-03-28 09:03:34 -07:00
Marc Mueller 8d2fb72cc3
Add type ignore error codes [core] (#66773) 2022-02-17 23:09:22 -08:00
Erik Montnemery b3421cf727
Remove Windows workarounds (#64068) 2022-01-13 20:41:11 +01:00
Erik Montnemery c60bb1890d
Remove unused group config view (#63434) 2022-01-05 12:16:11 +01:00
Erik Montnemery d4310f0d70
Remove groups.yaml from default config (#63366)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-01-04 23:16:08 -08:00
Tobias Sauerwein 2c904c0974
Bump mypy to 0.930 (#62642)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2021-12-27 17:55:17 +01:00
Ruslan Sayfutdinov 55f4962c06
Fix pylint plugin which checks relative imports (#62693) 2021-12-23 11:14:47 -08:00
Ville Skyttä 1ec8619687
Make core config source an enum (#61966)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-12-19 18:02:52 +01:00
Marc Mueller 77ee72cbb9
Import Callable from collections.abc (1) (#56775) 2021-09-29 16:32:11 +02:00
Marc Mueller 7af67d34cf
Use assignment expressions 01 (#56394) 2021-09-18 13:31:35 -10:00
Ville Skyttä 939fde0a50
ConfigType and async_setup/setup type hint improvements (#54739) 2021-08-18 13:22:05 +02:00
Paulus Schoutsen 952d11cb03
Ensure internal/external URL have no path (#54304)
* Ensure internal/external URL have no path

* Fix comment typo

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-08-09 09:38:09 +02:00
Paulus Schoutsen 8377b557da
Packages to support config platforms (#54085) 2021-08-05 13:11:01 -07:00
Marc Mueller 10bfc78365
Fix missing encoding with open() (#53593)
* Fix missing encoding with open()

* Fix tests

* Improve open - frontend
2021-07-28 09:41:45 +02:00
Franck Nijhof 1968b95829
Add currency core configuration (#53541)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-07-28 08:55:58 +02:00
Marc Mueller f6b162bc39
Add pylint CodeStyle extension (#53147) 2021-07-19 06:57:06 -07:00
Daniel Hjelseth Høyer fbad453c89
Pylint 2.9.3 (#52972)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2021-07-14 21:44:57 -07:00
Joakim Sørensen 3088f063d2
Don't overwrite existing files when generating configuration (#49815) 2021-04-28 17:15:04 +02:00
J. Nick Koston 3fa8ffa731
Enable mccabe complexity checks in flake8 (#49616)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-04-25 12:38:40 +02:00
Marc Mueller c07646db5d
Update typing syntax (#49480)
* Update typing syntax

* Replace typing imports with ones from collections where possible

* Changes after review
2021-04-20 17:40:41 +02:00
Marc Mueller e55702d635
Update typing 01 (#48013) 2021-03-17 17:34:55 +01:00
Paulus Schoutsen 2df644c6cc
Clean up secret loading (#47034) 2021-03-02 12:58:53 -08:00
J. Nick Koston 500cb17298
Ensure HomeAssistant can still restart when a library file is missing (#46664) 2021-02-19 22:22:48 -08:00
Joakim Sørensen dbb98e6cac
Replace LooseVersion with AwesomeVersion (#46330) 2021-02-10 15:26:38 +01:00
Ville Skyttä 82607977ef
Various type hint improvements (#46144) 2021-02-08 11:59:46 +01:00
Ville Skyttä 67eebce55a
Better general/fallback error message and traceback for unknown config errors (#44655)
* Include error repr in config error message is str(error) yields nothing

* Log traceback for config errors we don't have a "friendly" formatter for
2021-01-05 13:55:38 +01:00
Philip Allgaier bd1d6f2c0d
Add link to log view in persistent notification (#42060) 2020-10-21 12:09:45 -05:00
Paulus Schoutsen 440570244d
Don't swallow all errors when checking for config validator platform (#42058) 2020-10-19 17:09:57 +02:00
Franck Nijhof ee914366a8
Add native Python types support to templates (#41227)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-10-07 00:05:52 +02:00
Bram Kragten 510e90803e
Exclude media_dirs from YAML config check (#41299) 2020-10-05 22:09:47 +02:00
Franck Nijhof f83f3c927a
Fix local media browser source conflicting with local www folder (#40151) 2020-09-16 21:38:40 +02:00
Franck Nijhof ff0562ad1e
Add media dirs core configuration (#40071)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-09-16 15:28:25 +02:00
Jason Hunter f2b3e63ff6
Media Source implementation for Chromecast (#39305)
* Implement local media finder and integrate into cast

* update to media source as a platform

* Tweak media source design

* fix websocket and local source

* fix websocket schema

* fix playing media

* Apply suggestions from code review

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

* Add resolve_media websocket

* Register that shit

* Square brackets

* Sign path

* add support for multiple media sources and address PR review

* fix lint

* fix tests from auto whitelisting config/media

* allow specifying a name on the media source

* add tests

* fix for python 3.7

* Apply suggestions from code review

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

* add http back to cast and remove guess_type from executor as there is no i/o

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-09-04 11:16:29 -04:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Franck Nijhof 93c6a9cd96
Fix swapped variables deprecation in log message (#37901) 2020-07-16 10:08:05 +02:00
Paulus Schoutsen 8ed1a29c82
Drop white blacklist pt1 (#37816) 2020-07-13 17:43:11 +02:00
Aaron Bach 7968cd650a
Add concept of allowed external URLs to config (#36988)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-06-24 17:37:01 -07:00
Franck Nijhof 0146f35687
Fix packages when config schema is fully deprecated (#36674)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-06-11 10:59:52 -07:00
Ville Skyttä b4404b071f
Pylint cleanups (#35409)
* Avoid some outer name redefinitions

* Remove unneeded directives

* Narrow directive scope

* Don't disable redefined-variable-type
2020-05-09 14:08:40 +03:00
Franck Nijhof 2223592486
Add get_url helper, deprecate base_url (#35224) 2020-05-08 02:29:47 +02:00
Paulus Schoutsen a2fab264c4
Fix identifying Plex schema when used in packages (#34651) 2020-04-24 09:52:23 -07:00
Franck Nijhof 98a2efcbab
Collection of random (mainly) test improvements (#33733) 2020-04-06 12:51:48 +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 7653dc947a
Enable pylint unnecessary-pass (#33650)
* Enable pylint unnecessary-pass

* Process review suggestions

* Fix smhi tests
2020-04-05 10:33:07 +02:00
Franck Nijhof 22ae498f3a
Remove redundant open modes (#33652) 2020-04-04 22:49:15 +02:00
Franck Nijhof b9b1cee403
Enable pylint import-outside-toplevel (#33631) 2020-04-04 17:07:36 +02:00
Erik Montnemery 3a74066529
Small cleanup in async_process_ha_core_config (#33583) 2020-04-03 09:44:20 -07:00
Paulus Schoutsen b6d9454b54
Fix package default extraction (#33071) 2020-03-20 20:27:37 -07:00
Paulus Schoutsen d16d44d3e7
Add negative tests for identify schema for packages (#33050) 2020-03-20 13:34:56 -07:00
Franck Nijhof 661101df08
Fix packages for schemas without a default (#33045) 2020-03-20 08:17:43 -07:00
Paulus Schoutsen c3c5cc9ae7
Fix zones in packages (#33027) 2020-03-19 20:45:26 -07:00
springstan b41cbe9885
Add www. to all documentation links (#32063)
* Add www. to all documentation links

* Fix broken redirect uri test
2020-02-21 16:10:02 -08:00
Paulus Schoutsen fbbb29a6ec
Catch unexpected exceptions when validating config (#31795) 2020-02-13 22:43:07 +01:00
Paulus Schoutsen 5fdc60e067
Add Safe Mode (#30723)
* Store last working HTTP settings

* Add safe mode

* Fix tests

* Add cloud to safe mode

* Update logging text

* Fix camera tests leaving files behind

* Make emulated_hue tests not leave files behind

* Make logbook tests not leave files behind

* Make tts tests not leave files behind

* Make image_processing tests not leave files behind

* Make manual_mqtt tests not leave files behind
2020-01-14 13:03:02 -08: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ä e6388e186c
Remove unnecessary string literal concatenations (#30360) 2020-01-02 21:17:10 +02:00
Franck Nijhof 0439d6964c Fix persistent setup error notification content (#29995)
* Fix persistent setup error notification content

* Use documentation from manifest, enriched error messages

* Fix issue caught by mypy
2019-12-16 20:16:23 +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
Ville Skyttä 99c7608fb4 Lint config cleanups (#28864)
* Remove bunch of unneeded lint exclusions

* Use symbolic names instead of identifiers in pylint disables

* Tighten scope of some pylint disables
2019-11-25 22:40:08 -08:00
Franck Nijhof 5fcfdee6b5
Fix documentation URL in failed platform config check (#28814)
* Fix documentation URL in failed platform config check

* Replace pop from list by access using negative index

* Use of split instead of rsplit
2019-11-19 18:33:09 +01:00
Bram Kragten e419689229 Add config endpoint for scene (#28429)
* Add config endpoint for scene

* Add scenes to default config

* Fix test and add context to websocket service call

* Update scene.py

* Add tests
2019-11-04 12:38:18 -08:00
Paulus Schoutsen 93f9afcd21
Fix config imports (#27669)
* Fix config imports

* Remove old migration

* Remove migrate tests
2019-10-15 16:15:26 -07:00
Paulus Schoutsen 3231e22ddf
Remove direct authentication via trusted networks or API password (#27656)
* Remove direct authentication via trusted networks and API password

* Fix tests
2019-10-14 14:56:45 -07:00
Franck Nijhof d4a67e3a30 Update documentation link URL for integrations (part2) (#27117) 2019-10-02 09:34:07 -07:00
Erik Montnemery e57e7e8449
Improve validation of device trigger config (#26910)
* Improve validation of device trigger config

* Remove action and condition checks

* Move config validation to own file

* Fix tests

* Fixes

* Fixes

* Small tweak
2019-09-27 17:48:48 +02:00
Franck Nijhof 0df1b4c7a1 Replaces IOError by OSError (#26428) 2019-09-04 19:09:24 +02: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 6f357cb23e First pass fixing tests that raise exceptions caught by asyncio.gather (#25860)
* First pass fixing tests that raise exceptions caught by asyncio.gather

* Fix demo test

* lint
2019-08-12 16:42:12 +02:00
Johann Kellerman 8b9d0593b1 Allow components with empty list config (i.e. person) in packages (#25827)
* Fix #23424

* mypy Lists
2019-08-10 16:30:33 -07:00
Joakim Plate d1b9ebc7b2 Integration requirement check refactor (#25626)
* Factor out code getting requirements for integration

* Have process requirements raise an exception

* One more lint fix

* Blackify

* Catch new exception

* Let RequirementsNotFound be a HomeAssistantError

* Correct another test

* Split catching of exceptions and avoid complete log
2019-08-07 15:35:50 -07:00