Bad Indentation of a Mapping

Tags: #<Tag:0x00007f3270d3ef38>

I am trying to add the Alpha Vantage so my Home Assistant but it marks me that I have a bad indentation even when I literally copy paste the code form the guide

- platform: alpha_vantage
  api_key: YOUR_API_KEY
    symbols:
      - name: Google
        currency: USD
        symbol: GOOGL
    foreign_exchange:
      - from: BTC
        to: USD
        name: Bitcoin
bad indentation of a mapping entry at line 2, column 12:
        api_key: YOUR_API_KEY
               ^

I swear that the copy past is messing the indentation

Something went wrong during the copy-paste because, if you look carefully, what you posted is indented incorrectly.

Check the example again. All the options should be vertically aligned with the word ‘platform’.

You need to look at the guide again.

Specifically, look at the indentation of the second and subsequent lines compared to the first.

Thank you this was driving me crazy, I swear that the copy past is messing the indentation

1 Like