Ceci est mon premier essai d’intégration Homeasssistant
Pour développer cette intégration, un environement homeassistant development a été mis en place.
python3 -m script.scaffold integration
What is the domain?
> myint
What is the name of your integration?
> essai
What is your GitHub handle?
> jcoenencom
Error: GitHub handles need to start with an "@"
What is your GitHub handle?
> @jcoenencom
What PyPI package and version do you depend on? Leave blank for none.
>
How will your integration gather data?
Valid values are assumed_state, calculated, cloud_polling, cloud_push, local_polling, local_push
More info @ https://developers.home-assistant.io/docs/creating_integration_manifest#iot-class
> local_polling
Does Home Assistant need the user to authenticate to control the device/service? (yes/no) [yes]
> no
Is the device/service discoverable on the local network? (yes/no) [no]
> no
Is this a helper integration? (yes/no) [no]
>
Can the user authenticate the device using OAuth2? (yes/no) [no]
>
Scaffolding integration for the myint integration...
Writing tests/components/myint/__init__.py
Writing homeassistant/components/myint/manifest.json
Writing homeassistant/components/myint/__init__.py
Writing homeassistant/components/myint/const.py
Updating myint manifest: {'codeowners': ['@jcoenencom'], 'iot_class': 'local_polling'}
Scaffolding config_flow for the myint integration...
Writing homeassistant/components/myint/config_flow.py
Writing homeassistant/components/myint/__init__.py
Writing homeassistant/components/myint/const.py
Writing tests/components/myint/test_config_flow.py
Writing tests/components/myint/conftest.py
Updating myint manifest: {'config_flow': True}
Updating myint strings: ['config']
Running hassfest to pick up new information.
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/jcoenen/core/script/hassfest/__main__.py", line 244, in <module>
sys.exit(main())
^^^^^^
File "/home/jcoenen/core/script/hassfest/__main__.py", line 166, in main
plugin.validate(integrations, config)
File "/home/jcoenen/core/script/hassfest/codeowners.py", line 78, in validate
config.cache["codeowners"] = content = generate_and_validate(integrations, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jcoenen/core/script/hassfest/codeowners.py", line 53, in generate_and_validate
codeowners = integration.manifest["codeowners"]
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'codeowners'
Running gen_requirements_all to pick up new information.
Running script/translations_develop to pick up new translation strings.
**************************
Integration code has been generated
Added the following files:
- homeassistant/components/myint/const.py
- homeassistant/components/myint/__init__.py
- homeassistant/components/myint/config_flow.py
- homeassistant/components/myint/manifest.json
Added the following tests:
- tests/components/myint/conftest.py
- tests/components/myint/test_config_flow.py
The next step is to look at the files and deal with all areas marked as TODO.