fermartv / emt_madrid

Custom sensor to have the arrival time of the EMT Madrid buses in Home Assistant
MIT License
15 stars 1 forks source link

Updating to 2.0 #4

Closed PozoSer closed 1 year ago

PozoSer commented 1 year ago

First of all, thanks for the update! I've using this for a year and it's been wonderful.

If I understood correctly, the new config for several stops should be as follows:

sensor:
  - platform: emt_madrid
    email: !MY EMAIL
    password: !MY PASSWORD
    stop: 1
    lines:
        - "1"
    name: "!My stop #1"
    icon: "mdi:bus"
  - platform: emt_madrid
    email: !MY EMAIL
    password: !MY PASSWORD
    stop: 5
    lines:
        - "149"
    name: "!My stop #2"
    icon: "mdi:bus

Am I correct? If so, how should I add the sensors back to the dashboard? I am not able to find them on the search list by their previous names.

fermartv commented 1 year ago

Hi! That's almost correct. The name field is no longer supported and it's generated automatically. This is the correct configuration:

sensor:
  - platform: emt_madrid
    email: !MY EMAIL
    password: !MY PASSWORD
    stop: 1
    lines:
        - "1"
    icon: "mdi:bus"
  - platform: emt_madrid
    email: !MY EMAIL
    password: !MY PASSWORD
    stop: 5
    lines:
        - "149"
    icon: "mdi:bus"

For your case you can find the sensor names that start with:

Let me know if it works for you! :)

PozoSer commented 1 year ago

It works perfectly now. I remember the "name" field appearing on your "how to upgrade to 2.0" post, so you might want to check it. Thanks again!

fermartv commented 1 year ago

There was, indeed, a typo in the release section. It's fixed now. Thanks for pointing it out! 😃