Add app support for TVs to Vizio integration (#32432)

* add app support

* code cleanup, add additional test, add CONF_APPS storage logic for import

* simplify schema defaults logic

* remove unnecessary lower() and fix docstring

* remove default return for popping CONF_APPS during import update because we know entry data has CONF_APPS due to if statement

* further simplification

* even more simplification

* fix type hints

* move app configuration to separate step, fix tests, and only make app updates if device_type == tv

* remove errors variable from tv_apps and move tv_apps schema out of ConfigFlow for consistency

* slight refactor

* remove unused error from strings.json

* set unique id as early as possible

* correct which dictionary to use to set unique id in pair_tv step
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2020-03-05 13:34:12 -08:00
1 parent 873bf887a5
commit a579fcf248
12 files changed
+729 -73

No files matched your search

+11 -7
View File
@@ -4,7 +4,7 @@
"step": {
"user": {
"title": "Setup Vizio SmartCast Device",
"description": "All fields are required except Access Token. If you choose not to provide an Access Token, and your Device Type is 'tv', you will go through a pairing process with your device so an Access Token can be retrieved.\n\nTo go through the pairing process, before clicking Submit, ensure your TV is powered on and connected to the network. You also need to be able to see the screen.",
"description": "An Access Token is only needed for TVs. If you are configuring a TV and do not have an Access Token yet, leave it blank to go through a pairing process.",
"data": {
"name": "Name",
"host": "<Host/IP>:<Port>",
@@ -19,13 +19,17 @@
"pin": "PIN"
}
},
"pairing_complete": {
"title": "Pairing Complete",
"description": "Your Vizio SmartCast device is now connected to Home Assistant."
},
"pairing_complete_import": {
"title": "Pairing Complete",
"description": "Your Vizio SmartCast device is now connected to Home Assistant.\n\nYour Access Token is '**{access_token}**'."
"description": "Your Vizio SmartCast TV is now connected to Home Assistant.\n\nYour Access Token is '**{access_token}**'."
},
"user_tv": {
"title": "Configure Apps for Smart TV",
"description": "If you have a Smart TV, you can optionally filter your source list by choosing which apps to include or exclude in your source list. You can skip this step for TVs that don't support apps.",
"data": {
"include_or_exclude": "Include or Exclude Apps?",
"apps_to_include_or_exclude": "Apps to Include or Exclude"
}
}
},
"error": {
@@ -36,7 +40,7 @@
},
"abort": {
"already_setup": "This entry has already been setup.",
"updated_entry": "This entry has already been setup but the name and/or options defined in the configuration do not match the previously imported configuration, so the configuration entry has been updated accordingly."
"updated_entry": "This entry has already been setup but the name, apps, and/or options defined in the configuration do not match the previously imported configuration, so the configuration entry has been updated accordingly."
}
},
"options": {