Lovelace -- multiple !includes (merge lists)

I have a lovelace yaml dashboard, using # lovelace_gen.

I have a block inside my yaml where I !include some code.
It looks like this:

custom_actions:
    !include 
      - ../imports/firetv_actions_core.yaml
      - media_entity: {{ media_player_entity }}
        name: test

and firetv_actions_core.yaml (abbreviated), looks like this:

- type: button
  name: button_4
  tap_action: { action: "source", source: "Hulu" }
  icon: fapro:samsung-s#fullcolor
- type: button
  name: main_home
  tap_action: { action: "source", source: "Hulu" }
  icon: mdi:home-circle
- type: button
  name: red
  icon: fapro:firetv#fullcolor
  tap_action:
    action: perform-action
    perform_action: input_select.select_option
    target:
      entity_id: input_select.selected_media_player
    data:
      option: FireTV

It works.
BUT - I want to merge/!include another yaml file, with exactly the same structure, but non-overapping list items: my_room.yaml:

- type: button
  name: button_4
  tap_action: { action: "source", source: "Hulu" }
  icon: fapro:samsung-s#fullcolor
- type: button
  name: main_home
  tap_action: { action: "source", source: "Hulu" }
  icon: mdi:home-circle

I have tried:

custom_actions:
    !include 
      - ../imports/firetv_actions_core.yaml
      - media_entity: {{ media_player_entity }}
        name: test
    !include 
      - ../imports/my_room.yaml
      - media_entity: {{ media_player_entity }}
        name: test

But it doesn’t work. I am missing some fundamental understanding. Can anyone help?

FWIW, I could also put both the above !includes into separate json files, but am equally stuck on how to (a) load them, (b) merge them and (c) insert them!. What I want is the two !includes appended. There must be a way – but I can’t figure it out!

When I get through this hurdle, I also want the includes to be driven by variables.
i.e. if location == family room, include A and B, else include A and C.

Ugh. Stuck!

I am not using lovelace_gen.
But the syntax seems to be incorrect. This is correct:

xxxx: !include some_file.yaml 

but this “including a list” is something strange.
Ok, may be this is a lovelace_gen thing?
Update: looked at lovelace_gen docs briefly, yes, this syntax is supported.
Sorry for misleading.

So – I gave up with that approach (although I’d love to know how to do it).
Instead I converted the files to be imported into JSON.

And then:

{% macro import_json(source) %}
    {% include source %}
{% endmacro %}
...
custom_actions:
  {% set core = (import_json('/config/yaml/imports/firetv_actions_core.json') | fromjson) %}
  {% set porch = (import_json('/config/yaml/imports/firetv_actions_porch.json') | fromjson) %}
  {{ core + porch }}

…and bang! It works. Using the json approach also keeps me out of indentation hell.

Hope it helps someone else!

s.

Oh - and quick addendum.
It works with variables pass-through as well.

yaml parent:
{% set media_player_entity = media_player or "media_player.fire_tv" %}

json import:

{
      "type": "button",
      "name": "max",
      "tap_action": {
        "action": "perform-action",
        "perform_action": "androidtv.adb_command",
        "target": {
          "entity_id": "{{ media_player_entity }}"
        },
        "data": {
          "command": "am start -n com.hbo.hbonow/com.wbd.beam.BeamActivity"
        }
      },