lubeda / EspHoMaTriXv2

A simple DIY status display with a 8x32 RGB LED matrix, implemented with esphome.io and Home Assistant.
MIT License
269 stars 25 forks source link

[BUG] #201

Closed konus1 closed 7 months ago

konus1 commented 7 months ago

Bug report

Describe the bug

Automation based on easy-blueprints does not work with captial case name

Additional information

My EspHoMaTriXv2 device is called "Ulanzi-Tc001". In the automation there are service calls to esphome.{{ device_attr(display, "name") }}_icon_screen this renders in my case to esphome.Ulanzi-Tc001_icon_screen but needs to be esphome.ulanzi_tc001_icon_screen

I tried with

service: esphome.{{ device_attr(display, "name") | lower | replace ('-','_')  }}_icon_screen
service: esphome.{{ device_attr(display, "name") | slugify) }}_icon_screen
service: esphome.{{ device_attr(display, "name") | slugify(separator="_")  }}_icon_screen

but had no success - because of not enough knowledge to test and debug.

To Reproduce

Use a device with a Capital Case and/or separator other than "_" in the Name

Expected behavior

Automatically translate device name to service name sorry I am lost here :-)

lubeda commented 7 months ago

Hi, why don't you just replace the service with your value, since you know the correct value? I, personally, don't like my blueprints at all, so my advice is to use the manual way with automations. I removed them from the latest version.

To start manually, take a look at this version of the documentation. Hopefully, it is easier for beginners.

konus1 commented 7 months ago

You are right. Let me say Thank you for your work!