@@ -11,7 +11,10 @@ import "../../../../src/components/ha-alert";
1111import "../../../../src/components/ha-button-menu" ;
1212import "../../../../src/components/ha-card" ;
1313import "../../../../src/components/ha-form/ha-form" ;
14- import type { HaFormSchema } from "../../../../src/components/ha-form/types" ;
14+ import type {
15+ HaFormSchema ,
16+ HaFormDataContainer ,
17+ } from "../../../../src/components/ha-form/types" ;
1518import "../../../../src/components/ha-formfield" ;
1619import "../../../../src/components/ha-icon-button" ;
1720import "../../../../src/components/ha-list-item" ;
@@ -53,6 +56,13 @@ const ADDON_YAML_SCHEMA = DEFAULT_SCHEMA.extend([
5356
5457const MASKED_FIELDS = [ "password" , "secret" , "token" ] ;
5558
59+ function getFieldKey (
60+ entry : HaFormSchema ,
61+ options ?: { path ?: string [ ] }
62+ ) : string {
63+ return options ?. path ? [ ...options . path , entry . name ] . join ( "." ) : entry . name ;
64+ }
65+
5666@customElement ( "hassio-addon-config" )
5767class HassioAddonConfig extends LitElement {
5868 @property ( { attribute : false } ) public addon ! : HassioAddonDetails ;
@@ -79,16 +89,27 @@ class HassioAddonConfig extends LitElement {
7989
8090 @query ( "ha-yaml-editor" ) private _editor ?: HaYamlEditor ;
8191
82- public computeLabel = ( entry : HaFormSchema ) : string =>
83- this . addon . translations [ this . hass . language ] ?. configuration ?. [ entry . name ]
92+ public computeLabel = (
93+ entry : HaFormSchema ,
94+ _data : HaFormDataContainer ,
95+ options ?: { path ?: string [ ] }
96+ ) : string =>
97+ this . addon . translations [ this . hass . language ] ?. configuration ?. [
98+ getFieldKey ( entry , options )
99+ ] ?. name ||
100+ this . addon . translations . en ?. configuration ?. [ getFieldKey ( entry , options ) ]
84101 ?. name ||
85- this . addon . translations . en ?. configuration ?. [ entry . name ] ?. name ||
86102 entry . name ;
87103
88- public computeHelper = ( entry : HaFormSchema ) : string =>
89- this . addon . translations [ this . hass . language ] ?. configuration ?. [ entry . name ]
104+ public computeHelper = (
105+ entry : HaFormSchema ,
106+ options ?: { path ?: string [ ] }
107+ ) : string =>
108+ this . addon . translations [ this . hass . language ] ?. configuration ?. [
109+ getFieldKey ( entry , options )
110+ ] ?. description ||
111+ this . addon . translations . en ?. configuration ?. [ getFieldKey ( entry , options ) ]
90112 ?. description ||
91- this . addon . translations . en ?. configuration ?. [ entry . name ] ?. description ||
92113 "" ;
93114
94115 private _convertSchema = memoizeOne (
0 commit comments