fix(options): edit apps one row per step in a multiline field, and report discovery
The live Apps page showed the whole map as ONE long line with nowhere to add a
row. Cause: the field was a bare `vol.Optional(...): str`, and HA renders a
selector-less string as a SINGLE-LINE input (pre-fix wire field:
{"type": "string", "name": "app_name_map"} — no selector key). It is a
multiline TextSelector now: the real-HA test pins
selector.text.multiline on the wire and an N-line save/reopen round trip.
HA has no table selector, so the Apps sub-screen is a menu of row actions
(whole list as text / add / edit / remove) instead of one form:
- the EDIT row lists every app the user can act on: the rows they saved AND the
apps discovery found, marked `[detected]`, each labelled "name (package id)"
or "package id (no name yet)" — the user's Shield exposes no device labels at
all, so the unnamed case is the common one and it must not read as its own id
twice, and picking it is how a name gets set (saving stores the row)
- add: package + name + optional icon, refused by the SAME `_valid_app_row`
rule the text field uses, with an error on the page
- edit: PREFILLED from the stored row (suggested values — a voluptuous
`default=` never reaches the browser, so the form would have opened blank);
the device's mdi: icon is never prefilled into the icon column
- remove: pick a SAVED row, then an explicit confirmation menu; cancelling
keeps it (a detected app has no line to delete)
- edit/remove rows are offered only while something is stored
- every mutation writes ONE row through `_write_app_row`/`_drop_app_row`, so
untouched rows and their icons stay byte-for-byte as they were
The Discover row was a silent no-op ("seems to load then do nothing"): it now
returns a one-line verdict the menu shows — N apps found / the Shield reported
none / the sweep could not reach the Shield / ADB is not set up — while still
never raising and never caching a failed sweep as an answer.
Also fixes `async_step_menu_again`, which the real FlowManager dispatches with
user_input and which raised TypeError for every menu offering that row (only
reachable through a stub before, hence unnoticed).
Docs: README and BOTH strings files (byte-identical) describe the editor, the
one-per-line format, the detected-app dropdown and the four Discover verdicts.
This commit is contained in:
1 parent
eb62011ded
commit
46738063aa
8 files changed
+1369
-81
No files matched your search
@@ -121,7 +121,9 @@
|
||||
"protocol_unreachable": "The Shield did not answer at that address. Check the address above and that the Shield is awake, then select Submit to try again — or turn on 'Continue without protocol pairing' to finish setup without it.",
|
||||
"no_state_source": "No state source selected. Choose at least one: 'Add the Nvidia Remote Protocol' or 'Read state over ADB'.",
|
||||
"invalid_app_map": "Each line must be package=name with a non-empty package (no spaces) and a non-empty name — for example ar.tvplayer.tv=TiviMate.",
|
||||
"invalid_digit_delay": "The digit delay must be between 0.05 and 1.0 seconds."
|
||||
"invalid_digit_delay": "The digit delay must be between 0.05 and 1.0 seconds.",
|
||||
"invalid_app_row": "A row needs a package id with no spaces and a non-empty name — for example ar.tvplayer.tv=TiviMate. An icon, if given, cannot contain spaces.",
|
||||
"unknown_app_row": "That app is no longer in the list. Pick one of the rows offered, or add it again."
|
||||
},
|
||||
"abort": {
|
||||
"already_configured": "This Shield is already set up.",
|
||||
@@ -233,7 +235,18 @@
|
||||
},
|
||||
"apps": {
|
||||
"title": "Apps",
|
||||
"description": "One app per line: the package id, an equals sign, the name to show, and optionally a pipe and an icon (a picture URL or a camera entity id). Blank uses the built-in list.",
|
||||
"description": "The apps this Shield offers: they fill the media player's source list and name the apps in automations. Add, edit or remove ONE app with the rows below, or paste the whole list as text. The list carries the apps discovery found as well as the rows you saved — a detected app is marked, and picking it lets you give it a name. Currently: {apps}",
|
||||
"menu_options": {
|
||||
"apps_text": "Edit the whole list as text",
|
||||
"apps_add": "Add an app",
|
||||
"apps_edit": "Edit an app",
|
||||
"apps_remove": "Remove an app",
|
||||
"menu_again": "Back to the main menu"
|
||||
}
|
||||
},
|
||||
"apps_text": {
|
||||
"title": "Apps as text",
|
||||
"description": "One app per line: the package id, an equals sign, the name to show, and optionally a pipe and an icon (a picture URL or a camera entity id). Blank uses the built-in list. Icons the device reported: {icons} — the icon column itself takes a picture URL or a camera entity.",
|
||||
"data": {
|
||||
"app_name_map": "App names and icons"
|
||||
},
|
||||
@@ -241,6 +254,60 @@
|
||||
"app_name_map": "One row per app, for example ar.tvplayer.tv=TiviMate|http://192.168.1.10/tivi.png. The name is what the source list, the Current App sensor and the media player show."
|
||||
}
|
||||
},
|
||||
"apps_add": {
|
||||
"title": "Add an app",
|
||||
"description": "Adds ONE row. The package id is what the Shield launches, the name is what the card, the sensor and the source list show.",
|
||||
"data": {
|
||||
"app_package": "Package id",
|
||||
"app_name": "Name to show",
|
||||
"app_icon": "Icon (optional)"
|
||||
},
|
||||
"data_description": {
|
||||
"app_package": "The Android package id, for example ar.tvplayer.tv or com.netflix.ninja. No spaces.",
|
||||
"app_name": "What the source list, the Current App sensor and the media player show for this app.",
|
||||
"app_icon": "Optional: a picture URL or a camera entity id. Leave blank to show no picture."
|
||||
}
|
||||
},
|
||||
"apps_edit": {
|
||||
"title": "Edit an app",
|
||||
"description": "Pick the app to edit: the rows you saved plus the apps discovery found (marked 'detected'). The next step edits the name and the icon, and saving a detected app stores it as one of your own rows.",
|
||||
"data": {
|
||||
"app_package": "App"
|
||||
},
|
||||
"data_description": {
|
||||
"app_package": "Every app you can act on. '(no name yet)' means the device reported no label for it — pick it and type one. To change a package id itself, remove the row and add it again, or edit the whole list as text."
|
||||
}
|
||||
},
|
||||
"apps_edit_form": {
|
||||
"title": "Edit an app",
|
||||
"description": "Editing {app}. The package id identifies the row and is not changed here.",
|
||||
"data": {
|
||||
"app_name": "Name to show",
|
||||
"app_icon": "Icon (optional)"
|
||||
},
|
||||
"data_description": {
|
||||
"app_name": "What the source list, the Current App sensor and the media player show for this app.",
|
||||
"app_icon": "A picture URL or a camera entity id. Clear it to drop the picture."
|
||||
}
|
||||
},
|
||||
"apps_remove": {
|
||||
"title": "Remove an app",
|
||||
"description": "Pick the app to remove. Nothing is removed until you confirm on the next step.",
|
||||
"data": {
|
||||
"app_package": "App"
|
||||
},
|
||||
"data_description": {
|
||||
"app_package": "The rows saved so far. The confirmation is next."
|
||||
}
|
||||
},
|
||||
"apps_remove_confirm": {
|
||||
"title": "Remove an app",
|
||||
"description": "Remove {app} from the list? It leaves the source list when you save, and the app itself stays installed on the Shield.",
|
||||
"menu_options": {
|
||||
"apps_remove_yes": "Remove it",
|
||||
"apps_remove_no": "Keep it"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"title": "Scripts",
|
||||
"description": "Optional: run a Home Assistant script instead of the built-in command, per command. Clear a row to go back to the built-in path.",
|
||||
|
||||
Reference in new issue
Block a user