Ask for IoT class during scaffold (#49647)

Co-authored-by: Milan Meulemans <milan.meulemans@live.be>
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Paulus Schoutsen
2021-04-25 03:13:22 -07:00
committed by GitHub
parent b92f29997e
commit 9f8e683ae3
5 changed files with 23 additions and 4 deletions

View File

@ -2,6 +2,7 @@
import json
from homeassistant.util import slugify
from script.hassfest.manifest import SUPPORTED_IOT_CLASSES
from .const import COMPONENT_DIR
from .error import ExitApp
@ -46,6 +47,7 @@ def gather_info(arguments) -> Info:
"codeowner": "@developer",
"requirement": "aiodevelop==1.2.3",
"oauth2": True,
"iot_class": "local_polling",
}
)
else:
@ -86,6 +88,22 @@ def gather_new_integration(determine_auth: bool) -> Info:
]
],
},
"iot_class": {
"prompt": (
f"""How will your integration gather data?
Valid values are {', '.join(SUPPORTED_IOT_CLASSES)}
More info @ https://developers.home-assistant.io/docs/creating_integration_manifest#iot-class
"""
),
"validators": [
[
f"You need to pick one of {', '.join(SUPPORTED_IOT_CLASSES)}",
lambda value: value in SUPPORTED_IOT_CLASSES,
]
],
},
}
if determine_auth: