Commit Graph

151 Commits (ba38f2e43bd1be382b6705b060f512b6d84cd79e)

Author SHA1 Message Date
Joakim Sørensen f7c936e842
Add scaffold template for backup (#68961) 2022-03-31 14:18:45 +02:00
Erik Montnemery f9f360c64e
Rename helper_config_entry_flow to schema_config_entry_flow (#68924) 2022-03-30 14:36:47 -07:00
Franck Nijhof 8aff8d89d2
Clean up async_reproduce_state helper usage (#68617) 2022-03-24 14:40:54 +01:00
Erik Montnemery c44d7205cf
Rename HelperFlowStep to HelperFlowFormStep (#68583) 2022-03-23 14:43:11 -07:00
Erik Montnemery a50bac5cc2
Make initial group config flow step a menu (#68565) 2022-03-23 08:34:44 -07:00
Erik Montnemery 34063836ba
Fix scaffold script (#68516) 2022-03-22 19:51:24 +01:00
Erik Montnemery ead5b3e2c0
Improve strings for helper flow scaffold (#68257) 2022-03-17 13:14:38 +01:00
Erik Montnemery f0dba8ec70
Add scaffold for helper integration config flow (#67803) 2022-03-16 12:57:56 +01:00
Paulus Schoutsen 58321c50e1
Fix scaffold (#67769) 2022-03-07 01:13:39 +01:00
Erik Montnemery 209a5854f8
End JSON files updated by scaffold script with a newline (#67639) 2022-03-04 15:50:23 +01:00
Joakim Sørensen 4e6f35f4fb
Use assignment expression for unload_ok in scaffold templates (#64286) 2022-01-17 14:49:26 +01:00
Joakim Sørensen 5a33610739
Use Platform enum in scaffold templates (#64091) 2022-01-14 02:13:56 +02:00
Marc Mueller d057850971
Update typing - collections.abc (3) (#63947) 2022-01-12 08:04:17 +01:00
Ville Skyttä 334c6c5c02
Make device automation type an enum (#62354) 2021-12-20 19:16:30 +01:00
Erik Montnemery 0e3bc21d54
Teach state and numeric_state conditions about entity registry ids (#60841) 2021-12-02 14:55:12 -08:00
Erik Montnemery c85bb27d0d
Teach state trigger about entity registry ids (#60271)
* Teach state trigger about entity registry ids

* Tweak

* Add tests

* Tweak tests

* Fix tests

* Resolve entity ids during config validation

* Update device_triggers

* Fix mistake

* Tweak trigger validator to ensure we don't modify the original config

* Add index from entry id to entry

* Update scaffold

* Pre-compile UUID regex

* Address review comment

* Tweak mock_registry

* Tweak

* Apply suggestion from code review
2021-12-02 14:26:45 +01:00
Erik Montnemery caf5ee2fab
Remove optional validation when creating conditions (#60481) 2021-11-28 14:54:07 +01:00
Paulus Schoutsen a4d9019ffc
Refactor persistent notification to no longer route all data via a service (#57157)
* Convert persistent notification tests to async

* Create/dismiss persistent notifications in exposed functions, not service calls

* Fix notify persistent_notification

* Remove setting up persistent_notification

* Drop more setups

* Empty methods

* Undeprecate sync methods because too big task

* Fix setup clearing notifications

* Fix a bunch of tests

* Fix more tests

* Uno mas

* Test persistent notification events

* Clean up stale comment

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-07 12:58:00 +02:00
Ville Skyttä b10fc89a6b
Automation trigger info type hint improvements (#55402)
* Make automation trigger info a TypedDict

* zwave_js trigger type hint fixes

* Remove redundant automation trigger info field presence checks

* Use async_initialize_triggers in mqtt and tasmota device_trigger tests
2021-09-04 02:25:51 +02:00
Tomasz Wieczorek 501e7c84be
Type scaffold PLATFORMS (#55699)
* Added template base type

Proposition to add typing, as pre-commit test on newly created integrations fails on it automatically:

```
homeassistant/components/<my_integration>/__init__.py:11: error: Need type annotation for "PLATFORMS" (hint: "PLATFORMS: List[<type>] = ...")  [var-annotated]
Found 1 error in 1 file (checked 4 source files)
```

I believe there shouldn't be other type than text, hence the proposition.

* Apply suggestions from code review

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-09-04 01:21:18 +02:00
Erik Montnemery cdaba62d2c
Add test fixture for unauthenticated HTTP client (#55561)
* Add test fixture for unauthenticated HTTP client

* Remove things from the future
2021-09-02 13:09:16 +02:00
Ville Skyttä 0095c6baeb
Improve device trigger type hinting (#54907) 2021-08-22 20:32:50 +02:00
Ville Skyttä 4bb2c6e00f
Improve device action type hinting (#54850)
* Improve device action type hinting

* More precise _async_get_automations type hints

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-08-20 07:13:25 +03:00
Paulus Schoutsen 4ae2a26aa3
Add config flow to Rainforest EAGLE-200 (#54846)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-08-19 09:22:30 -07:00
Ville Skyttä 939fde0a50
ConfigType and async_setup/setup type hint improvements (#54739) 2021-08-18 13:22:05 +02:00
Paulus Schoutsen 0b71055989
Do not automatically add title to strings.json (#53350) 2021-07-22 21:11:10 +02:00
Paulus Schoutsen 989839a1a9
Generate const files for config flow scaffolds (#53064) 2021-07-15 19:57:06 +02:00
Milan Meulemans 63e20f2ced
Mark config flow fields as required (#51898)
* flo

* goalzero

* mutesync

* ring

* roon

* risco

* Ruckus Unleashed

* Scaffold template
2021-06-15 19:21:30 +02:00
Erik Montnemery bf6a412be0
Tweak device action scaffold, fix typo (#51751) 2021-06-11 23:22:18 +02:00
Erik Montnemery 76c3058d15
Rename device trigger base schema to DEVICE_TRIGGER_BASE_SCHEMA (#51719) 2021-06-10 19:11:38 +02:00
Erik Montnemery 04e9acc20a
Simplify device condition code (#51266) 2021-05-31 09:47:30 +02:00
Erik Montnemery 489c73b4da
Simplify device action code (#51263) 2021-05-31 09:47:15 +02:00
Ville Skyttä c2f5dcefa5
Use flow result type constants more (#51122) 2021-05-29 14:09:13 +02:00
Milan Meulemans 5491040693
Fix missing link in scaffold comment (#50936) 2021-05-21 21:21:26 +02:00
Franck Nijhof 96f69fb9fb
Finalize clean up connection classes (#49895) 2021-05-04 20:08:51 +02:00
Franck Nijhof c68b259bd3
Cleanup of unused connection_class logic (#49865)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-04-29 23:12:58 +02:00
Ruslan Sayfutdinov a4db35a16e
Rename FlowResultDict in scaffold template (#49858) 2021-04-29 17:10:31 +02:00
J. Nick Koston 51be2f860a
Reduce boilerplate to setup config entry platforms A-C (#49681)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-04-26 07:46:55 -10:00
Paulus Schoutsen 9f8e683ae3
Ask for IoT class during scaffold (#49647)
Co-authored-by: Milan Meulemans <milan.meulemans@live.be>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-04-25 12:13:22 +02:00
Milan Meulemans 48695869f9
Change dict[str, Any] to FlowResultDict (#49546) 2021-04-22 17:23:15 -10:00
Erik Montnemery b26779a27a
Add id to automation triggers (#48464) 2021-03-31 14:56:04 +02:00
Marc Mueller 2956eb0902
Update pylint to 2.7.3 (#48488)
* Update pylint to 2.7.3

* Add class-const-naming-style

* Remove unused-import message

* Additional cleanup
2021-03-29 18:02:56 -10:00
Franck Nijhof 52475c108f
Make integration setup optional (#48381) 2021-03-29 13:53:47 -07:00
Franck Nijhof d2d78d6205
Extend typing on scaffold templates (#48232) 2021-03-26 15:19:44 +01:00
Martin Hjelmare 3742f175ad
Add missing oauth2 error abort reason (#48112) 2021-03-19 14:27:26 +01:00
Marc Mueller 4cb7718192
Update typing 16 (#48087) 2021-03-18 22:58:19 +01:00
Quentame 198ecb0945
Uniformize platform setup (#47101)
* A platform is not a component

* Fix dynalite

* SUPPORTED_PLATFORMS --> PLATFORMS

* In tests

* In tests 2

* Fix SmartThings

* Fix ZHA test

* Fix Z-Wave

* Revert Z-Wave

* Use PLATFORMS const in ambient_station

* Fix ihc comment
2021-03-02 21:43:59 +01:00
Martin Hjelmare 568180632e
Fix sync oath2 scaffold template (#46219) 2021-02-08 15:00:17 +01:00
Erik Montnemery f99c27c6d4
Remove unneeded from_state from device triggers (#45152) 2021-02-08 11:09:45 +01:00
Paulus Schoutsen 352d0870e3
Light significant changes + sensor tweaks (#45583) 2021-01-26 22:11:06 +01:00
Paulus Schoutsen 712a5a098d
Add significant change filtering to Google (#45566) 2021-01-26 21:45:09 +01:00
Paulus Schoutsen d082be787f
Add "significant change" base (#45555) 2021-01-26 14:13:27 +01:00
Paulus Schoutsen e584902b8b
Remove empty schema (#45044) 2021-01-11 14:25:09 +01:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Paulus Schoutsen 7d23ff6511
Add device action to mobile app to notify (#43814) 2020-12-01 18:14:01 +01:00
Paulus Schoutsen f9fa24950b
OAuth2 to use current request header (#43668) 2020-11-27 08:55:34 +01:00
Allen Porter b228ffc761
Add missing config flow translation key to script scaffold (#42621)
Add missing config key for no_url_available when generating new oauth2
config entry based integrations.  This was found in issue #42423 where
the nest integration was missing a string when a user had a misconfiguration.
2020-10-30 09:51:22 +01:00
Paulus Schoutsen 1c36bf5e19
Fix block till done in create entry config flow tests (#42290) 2020-10-24 16:20:56 +02:00
Paulus Schoutsen e7b6903ef4
Improve the readability of the config flow code (#42169) 2020-10-22 13:00:55 +02:00
Philip Allgaier dde6305549
Cleanup unused loggers (components N-Z + tests) (#41982) 2020-10-16 21:24:08 -05:00
Allen Porter 42cef1773b
Update script scaffold templates for config_flow_oauth2 (#41181)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-10-07 15:23:45 +02:00
Daniel Hjelseth Høyer 9d3ddb8981
Scaffold: correct import (#40998) 2020-10-02 08:32:03 +02:00
Aidan Timson 09efbc569f
Fix oauth2 template by updating outdated method name (#39486) 2020-08-31 10:25:25 +02:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Martin Hjelmare b4142fc7ee
Add const module to oauth2 scaffold template (#35438)
* Add const module to oauth2 template

* Remove const append

* Add domain to const
2020-05-10 12:10:09 +02:00
Paulus Schoutsen 42fc332123
Fix scaffold and hassfest references (#35431) 2020-05-09 15:50:44 -07:00
Paulus Schoutsen 34e35f6aa3
Add config flow base strings (#34523) 2020-05-04 20:10:39 -07:00
Paulus Schoutsen ec47216388
Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
Ville Skyttä 435a88636a
Address new issues flagged by flake8 3.8.0a2 (#34964) 2020-04-30 21:37:58 +02:00
Paulus Schoutsen e002c84eba
Don't set step title if it's integration title (#34524) 2020-04-22 15:05:39 +02:00
Franck Nijhof bc5a2da7b7
Add transition support to scenes, cleanup blocking parameter (#34434) 2020-04-20 18:07:50 -07:00
Paulus Schoutsen d36204a968
Move title translation to root (#33850) 2020-04-15 09:41:18 -07:00
Paulus Schoutsen 8e6e8dfbe0
Migrate translations_develop script (#33933)
* Migrate translations_develop script

* Fix lint
2020-04-10 14:17:09 -07:00
Paulus Schoutsen f975654ae7
Mock setup_entry in oauth2 tests (#32102)
* Mock setup_entry in oauth2 tests

* Fix scaffold constant
2020-02-23 12:23:21 +01:00
Paulus Schoutsen 71a81c443f
Limit translations_develop to an integration (#31804)
* limit translations_develop to english

* Convert to Python

* Limit to integration

* Add to hassfest

* Remove old bash comment
2020-02-14 09:26:50 -08:00
Christian Clauss df7d2b3aeb
Fix typos found by codespell (#31243)
* Fix typos found by codespell

* Fix typos found by codespell

* codespell: Furture  ==> Future

* Update test_config_flow.py

* Update __init__.py

* Spellcheck: successfull  ==> successful

* Codespell: unsuccesful  ==> unsuccessful

* Codespell: cant  ==> can't

* Codespell: firware ==> firmware

* Codespell: mimick  ==> mimic
2020-01-31 08:33:00 -08:00
Paulus Schoutsen e9e44dbd97
Fix callback and async (#31281)
* Fix callback and async

* Fix a return

* Fix test

* Fix mqtt tests

* Fix some more callbacks
2020-01-29 13:59:45 -08:00
Christian Clauss 1d537ad416 Fix typo: serivce --> service (#31217) 2020-01-27 19:56:26 +01:00
Ville Skyttä 5e2ba2eb77
Enable some more bandit checks (#30857)
* Enable B108 (hardcoded tmp dir), address findings

* Enable B602 (subprocess popen with shell), address findings

* Enable B604 (start process with shell), address findings

* Enable B306 (mktemp), B307 (eval), and B325 (tempnam), no issues to address
2020-01-20 18:44:55 +02:00
Paulus Schoutsen f50714d7e9 Update config flow test scaffolding (#30694)
* Update config flow test scaffolding

* asyncpatch -> patch

* Update classname
2020-01-13 15:20:25 +01:00
Ville Skyttä 5216477353
Be consistent with Home Assistant and Hass.io spelling (#30500)
* Be consistent with Home Assistant spelling

* Be consistent with Hass.io spelling
2020-01-05 14:09:17 +02:00
cgtobi d4ff214fce Clean up scaffold (#30135) 2019-12-22 19:53:03 +01:00
Paulus Schoutsen b058742404
Fix condition typo (#29989) 2019-12-16 09:33:11 +01:00
Bas Nijholt 5cb6d1b21f Sort imports according to PEP8 for 'script' folder (#29790) 2019-12-09 16:24:03 +01:00
Paulus Schoutsen 004476a1f8 Add intent integration to expose intent handle API (#29124)
* Add intent integration to expose intent handle API.

* Run hassfest + fix scaffolding

* Update __init__.py
2019-11-27 11:25:43 +01:00
cgtobi 6da01904c4 Fix typo in scaffold generator script (#29058) 2019-11-25 14:42:40 +01:00
Paulus Schoutsen 16a80beb43 Fix scaffold 2019-11-04 14:14:57 -08:00
Fabian Affolter 314c3d0965 Use integration name in docstring (#28445) 2019-11-02 21:28:07 -07:00
Paulus Schoutsen 24c29f9227
Add OAuth2 config flow scaffold (#28220)
* Add OAuth2 scaffold

* Generate integration if non-existing domain specified

* Update URL
2019-10-29 20:34:03 -07:00
Ville Skyttä 759ad08930 Typing misc fixes (#27543)
* Make async_get_conditions return type hint more specific

* Exclude script/scaffold/templates/ from pre-commit mypy
2019-10-14 13:03:37 -07:00
Paulus Schoutsen a82ff4f7a9
Add strings for device automations to scaffold (#27556) 2019-10-12 14:09:06 -07:00
Erik Montnemery dbe366933f Fix typing for device condition scaffold (#27487) 2019-10-12 16:37:32 +03:00
Erik Montnemery 0ba4ee1398 Validate generated device actions (#27262)
* Validate generated actions

* Use hass.services.async_call instead of service.async_call_from_config
2019-10-08 10:06:17 -07:00
Erik Montnemery c72ac87c73 Fix device condition scaffold (#27300) 2019-10-07 20:10:21 -07:00
Erik Montnemery dabdf8b577 Validate generated device triggers (#27264)
* Validate generated trigger

* Update scaffold
2019-10-07 13:09:48 -07:00
Franck Nijhof d4a67e3a30 Update documentation link URL for integrations (part2) (#27117) 2019-10-02 09:34:07 -07:00
Paulus Schoutsen 58446c79fc Update scaffold text 2019-09-27 13:08:38 -07:00
Paulus Schoutsen 77654da341
Add templates to scaffold device_trigger, device_condition, (#26871)
device_action
2019-09-27 12:54:17 -07:00
Paulus Schoutsen 53e6b8ade6
Add reproduce state template (#26866)
* Add reproduce state template

* Handle invalid state
2019-09-23 23:23:53 -07:00
Paulus Schoutsen 5a4a3e17cc Split scaffolding script (#26832)
* Add scaffolding split

* Add second config flow method
2019-09-22 21:46:50 -06:00