home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.45k stars 30.69k forks source link

Extend package: does not support weblinks yet #14920

Closed brianhanifin closed 6 years ago

brianhanifin commented 6 years ago

Home Assistant release with the issue: 0.71.0

Last working Home Assistant release (if known): N/A

Operating environment (Hass.io/Docker/Windows/etc.): Docker/Ubuntu

Component/platform: packages: This is related to #14611 @cdce8p

Description of problem: I get an error when I click Check Config (see Traceback below).

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

# packages/weblink.yaml
weblink:
  entities:
    - name: Alexa
      icon: mdi:amazon-alexa
      url: https://alexa.amazon.com
    - name: Grafana
      icon: mdi:chart-pie
      url: http://10.0.0.56:3000

# packages/sonoff.yaml
weblink:
  entities:
    - name: Sonoff01
      url: http://10.0.0.40
    - name: Sonoff02
      url: http://10.0.0.41
    - name: Sonoff Pow01

Traceback (if applicable): UPDATED 6/11/18: Apologies for the incorrect error message originally.

Configuration invalid
Package weblinks setup failed. Component weblink duplicate key 'entities'

Additional information: If I understand the description (of #14611) properly, this should allow me to add weblink headers to more than one package file, right? I would like to, for example be able to define tasmota admin links devices in my sonoff.yaml package.

If I misunderstood and this is outside of this scope of this PR then you can close this issue.

point-4ward commented 6 years ago

Your formatting is wrong. You've missed one of the i's out of 'entities' somewhere, as evidenced by the missing i from the word entities in the error message.

Weblinks work fine in packages.

brianhanifin commented 6 years ago

Sorry, that was a quick and dirty example... I didn't proofread the error message. Here is the correct error message:

Configuration invalid CHECK CONFIG
Package weblinks setup failed. Component weblink duplicate key 'entities'

With the corrected examples of:

# weblinks.yaml
weblink:
  entities:
    - name: Alexa
      icon: mdi:amazon-alexa
      url: https://alexa.amazon.com
    - name: Grafana
      icon: mdi:chart-pie
      url: http://10.0.0.56:3000

# sonoff.yaml
weblink:
  entities:
    - name: Sonoff01
      url: http://10.0.0.40
    - name: Sonoff02
      url: http://10.0.0.41
    - name: Sonoff Pow01
cdce8p commented 6 years ago

I can reproduce the issue. Will hopefully be able to push a fix soon.

Mariusthvdb commented 6 years ago

i can support the issue, and report it is already on Hassio 0.70.1

cool if this could be fixed indeed.

cdce8p commented 6 years ago

Hi everyone! I finally finished the fix (see #14980). Anyone able to test the changes and confirm they work. I've done my own tests but could still have missed something.

brianhanifin commented 6 years ago

I can confirm that weblinks: can exist in two separate package files, on the latest docker :dev version. Thank you @cdce8p!

cdce8p commented 6 years ago

@brianhanifin Thanks for testing. If you notice any other issues with packages, let me know. It's quite difficult to test all possible cases, but it should all work.