Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integration scaffolding script #26777

Merged
merged 3 commits into from Sep 21, 2019

Conversation

@balloob
Copy link
Member

commented Sep 20, 2019

Description:

Inspired by home-assistant/architecture#289

Add a script to scaffold a new integration that includes a manifest, config flow and tests for that config flow. No one should ever be able to complain that it is too difficult to write a new integration. Output of running python3 -m script.scaffold:

Creating a new integration for Home Assistant.

What is the domain?
> paulus

What is the name of your integration?
> Paulus Hub

What is your GitHub handle?
> @balloob

What PyPI package and version do you depend on? Leave blank for none.
> aioballoob==1.0.3

Generating the paulus integration...
Writing homeassistant/components/paulus/error.py
Writing homeassistant/components/paulus/__init__.py
Writing homeassistant/components/paulus/manifest.json
Writing homeassistant/components/paulus/strings.json
Writing homeassistant/components/paulus/const.py
Writing homeassistant/components/paulus/config_flow.py
Writing tests/components/paulus/__init__.py
Writing tests/components/paulus/test_config_flow.py

Running hassfest to pick up new codeowner and config flow.
Warning: mobile_app references integration cloud but it's not a dependency
Warning: proxy references integration camera but it's not a dependency
Warning: auth references integration onboarding but it's not a dependency
Warning: cast references integration cloud but it's not a dependency
Warning: google_assistant references integration camera but it's not a dependency
Warning: onboarding references integration person but it's not a dependency
Warning: owntracks references integration cloud but it's not a dependency
Integrations: 878
Invalid integrations: 0

Running tests
$ py.test tests/components/paulus
Test session starts (platform: darwin, Python 3.7.4, pytest 5.1.1, pytest-sugar 0.9.2)
rootdir: /Users/paulus/dev/hass/home-assistant, inifile: setup.cfg
plugins: sugar-0.9.2, timeout-1.3.3, cov-2.7.1, aiohttp-0.3.0, requests-mock-1.6.0
collecting ...
 tests/components/paulus/test_config_flow.py ✓✓✓                                    100% ██████████

Results (0.20s):
       3 passed

Successfully created the paulus integration!

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
@project-bot project-bot bot added this to Needs review in Dev Sep 20, 2019
Dev automation moved this from Needs review to Reviewer approved Sep 20, 2019
@balloob balloob merged commit 8502f7c into dev Sep 21, 2019
11 checks passed
11 checks passed
CI Build #20190920.61 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch Coverage not affected when comparing 5cf9ba5...2354948
Details
codecov/project 94.05% (target 90%)
Details
Dev automation moved this from Reviewer approved to Done Sep 21, 2019
@delete-merged-branch delete-merged-branch bot deleted the scaffold branch Sep 21, 2019
@balloob balloob referenced this pull request Sep 21, 2019
@balloob

This comment has been minimized.

Copy link
Member Author

commented Sep 21, 2019

KJonline added a commit to KJonline/home-assistant that referenced this pull request Sep 21, 2019
* dev: (92 commits)
  Bump pynws version to 0.8.1 (home-assistant#26770)
  Bump HAP-python to 2.6.0 for homekit (home-assistant#26783)
  [ci skip] Translation update
  Add integration scaffolding script (home-assistant#26777)
  Bump simplisafe-python to 5.0.1 (home-assistant#26775)
  Bump aiowwlln to 2.0.2 (home-assistant#26769)
  ZHA siren and warning device support (home-assistant#26046)
  Add transport data from maps.yandex.ru api (home-assistant#26766)
  Type hint additions (home-assistant#26765)
  Bump openwrt-luci-rpc to version 1.1.1 (home-assistant#26759)
  Revert "Add transport data from maps.yandex.ru api (home-assistant#26252)" (home-assistant#26762)
  [ci skip] Translation update
  Updated frontend to 20190919.0
  deCONZ improve gateway tests (home-assistant#26709)
  Add transport data from maps.yandex.ru api (home-assistant#26252)
  Update codeowners (home-assistant#26733)
  Bump influxdb to 5.2.3 (home-assistant#26743)
  Izone component (home-assistant#24550)
  Bump restrictedpython to 5.0 (home-assistant#26741)
  Bumped version to 0.99.1
  ...
@lock lock bot locked and limited conversation to collaborators Sep 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
3 participants
You can’t perform that action at this time.