Miicroo / ha-birthdays

Birthday integration for HomeAssistant
24 stars 8 forks source link

Cannot be merged, expected a dict #23

Closed rikardronnkvist closed 3 days ago

rikardronnkvist commented 2 weeks ago

Getting this errormessage when adding the integraion as a package: Setup of package 'birthdays' failed: integration 'birthdays' cannot be merged, expected a dict

In the configuration.yaml i include my packages with

homeassistant:
  packages: !include_dir_named packages

The file packages/birthdays.yaml contains

birthdays:
  - name: Abc
    date_of_birth: 1111-22-33
  - name: Xyz
    date_of_birth: 1111-22-33

The complete errormessage:

ERROR (MainThread) [homeassistant.config] Setup of package 'birthdays' at packages/birthdays.yaml, line 1 failed: integration 'birthdays' cannot be merged, expected a dict

Worked just fine until 2024.11 (or maybe it broke in 2024.10, can't really remember).

Miicroo commented 1 week ago

@rikardronnkvist Checking! Which version are you using? Might be the new optional schema that is bothering packages, but that is fairly new so depending on version it might not be that

rikardronnkvist commented 1 week ago

2024.11

Miicroo commented 1 week ago

Sorry, I meant which version of the birthdays integration do you use?

Den fre 15 nov. 2024 06:29Rikard Ronnkvist @.***> skrev:

2024.11

— Reply to this email directly, view it on GitHub https://github.com/Miicroo/ha-birthdays/issues/23#issuecomment-2477991633, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSUSBHATMIH2CUZBVUUVQT2AWBC5AVCNFSM6AAAAABRYDAMWSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZXHE4TCNRTGM . You are receiving this because you commented.Message ID: @.***>

rikardronnkvist commented 1 week ago

Latest via HACS, 1.2.0

Miicroo commented 3 days ago

@rikardronnkvist Finally found a solution, based on an old bug in HomeAssistant that had the same problem! So it seems that the more complex schema introduced in birthdays 1.1.0 messes with the packages logic (but is fine when not using packages).

The solution is to add an extra birthdays:-key in there, otherwise the dict won't be named. A working schema for packages will look like this:

birthdays:
  birthdays:
    - name: Abc
      date_of_birth: 1111-22-33
    - name: Xyz
      date_of_birth: 1111-22-33
rikardronnkvist commented 3 days ago

Nice, that works :)