@@ -80,8 +80,8 @@ export function generateYaml(project: Project): string {
8080
8181 if ( settings . fallbackApEnabled ) {
8282 wifi . ap = {
83- ssid : settings . useSecretsFallbackAp ? '__SECRET__fallback_ap_ssid' : ( settings . fallbackApSsid || `${ settings . friendlyName } Fallback` ) ,
84- password : settings . useSecretsFallbackAp ? '__SECRET__fallback_ap_password' : ( settings . fallbackApPassword || 'fallback123' ) ,
83+ ssid : settings . useSecretsFallbackApSsid ? '__SECRET__fallback_ap_ssid' : ( settings . fallbackApSsid || `${ settings . friendlyName } Fallback` ) ,
84+ password : settings . useSecretsFallbackApPassword ? '__SECRET__fallback_ap_password' : ( settings . fallbackApPassword || 'fallback123' ) ,
8585 } ;
8686 }
8787 doc . wifi = wifi ;
@@ -288,10 +288,12 @@ export function generateYaml(project: Project): string {
288288 // ── time (SNTP) ──
289289 if ( settings . timeEnabled ) {
290290 const time : Record < string , unknown > = { platform : 'sntp' } ;
291+ if ( settings . _rawTimeExtras ?. id ) time . id = settings . _rawTimeExtras . id ;
291292 if ( settings . timeTimezone ) time . timezone = settings . timeTimezone ;
292293 if ( settings . timeServers ) {
293294 time . servers = settings . timeServers . split ( ',' ) . map ( ( s ) => s . trim ( ) ) . filter ( Boolean ) ;
294295 }
296+ if ( settings . _rawTimeExtras ?. on_time ) time . on_time = settings . _rawTimeExtras . on_time ;
295297 doc . time = [ time ] ;
296298 }
297299
@@ -777,6 +779,7 @@ function generateComponentEntry(
777779 base . name = str ( inst . config . name , inst . name ) ;
778780 // Use original output id from import if present, otherwise auto-generate
779781 base . output = inst . config . _outputId ? String ( inst . config . _outputId ) : `${ inst . id } _output` ;
782+ if ( inst . config . restore_mode ) base . restore_mode = inst . config . restore_mode ;
780783 break ;
781784 }
782785 case 'light.neopixelbus' : {
@@ -800,6 +803,7 @@ function generateComponentEntry(
800803 base . platform = 'ledc' ;
801804 if ( inst . pins . pin != null ) base . pin = `GPIO${ inst . pins . pin } ` ;
802805 base . id = inst . config . name ? String ( inst . config . name ) : inst . id ;
806+ if ( inst . config . inverted ) base . inverted = true ;
803807 if ( inst . config . frequency ) base . frequency = inst . config . frequency ;
804808 break ;
805809 }
@@ -1414,6 +1418,7 @@ function generateComponentEntry(
14141418 base . platform = 'template' ;
14151419 base . name = str ( inst . config . name , inst . name ) ;
14161420 if ( inst . config . device_class ) base . device_class = inst . config . device_class ;
1421+ if ( inst . config . _lambda ) base . lambda = inst . config . _lambda ;
14171422 break ;
14181423 }
14191424 case 'binary_sensor.analog_threshold' : {
@@ -1505,6 +1510,14 @@ function generateComponentEntry(
15051510 }
15061511 }
15071512
1513+ // Generic: emit _yamlId (component id distinct from name), _filters captured from import
1514+ if ( inst . config . _yamlId !== undefined && base . id === undefined ) {
1515+ base . id = inst . config . _yamlId ;
1516+ }
1517+ if ( inst . config . _filters !== undefined && base . filters === undefined ) {
1518+ base . filters = inst . config . _filters ;
1519+ }
1520+
15081521 return base ;
15091522}
15101523
@@ -1694,7 +1707,7 @@ function str(val: unknown, fallback: string): string {
16941707/** Generate a secrets.yaml file based on which secret flags are enabled */
16951708export function generateSecretsYaml ( project : Project ) : string | null {
16961709 const s = project . settings ;
1697- const anySecrets = s . useSecretsWifi || s . useSecretsApi || s . useSecretsOta || s . useSecretsMqtt || s . useSecretsFallbackAp ;
1710+ const anySecrets = s . useSecretsWifi || s . useSecretsApi || s . useSecretsOta || s . useSecretsMqtt || s . useSecretsFallbackApSsid || s . useSecretsFallbackApPassword ;
16981711 if ( ! anySecrets ) return null ;
16991712
17001713 const lines : string [ ] = [
@@ -1720,8 +1733,8 @@ export function generateSecretsYaml(project: Project): string | null {
17201733 lines . push ( `mqtt_password: "${ s . mqttPassword || 'YOUR_MQTT_PASSWORD' } "` ) ;
17211734 }
17221735
1723- if ( s . useSecretsFallbackAp && s . fallbackApEnabled ) {
1724- lines . push ( `fallback_ap_ssid: "${ s . fallbackApSsid || 'YOUR_AP_NAME' } "` ) ;
1736+ if ( ( s . useSecretsFallbackApSsid || s . useSecretsFallbackApPassword ) && s . fallbackApEnabled ) {
1737+ if ( s . useSecretsFallbackApSsid ) lines . push ( `fallback_ap_ssid: "${ s . fallbackApSsid || 'YOUR_AP_NAME' } "` ) ;
17251738 lines . push ( `fallback_ap_password: "${ s . fallbackApPassword || 'YOUR_AP_PASSWORD' } "` ) ;
17261739 }
17271740
0 commit comments