piitaya / lovelace-mushroom

Build a beautiful Home Assistant dashboard easily
Apache License 2.0
3.64k stars 334 forks source link

[Bug]: Error rendering template badges on Android companion app #1505

Closed milothomas closed 2 months ago

milothomas commented 2 months ago

Requirements

Current Behavior

The app shows an error message when rendering a template badge.

Expected Behavior

Renders the badge correctly as it does on the browser on the desktop.

Steps To Reproduce

Add a template badge to any dashboard and view the same using the Home Assistant Android companion app.

type: custom:mushroom-template-badge
content: Test
icon: mdi:sun-wireless-outline
color: blue
entity: sensor.openuv_current_uv_level
label: UV Index
tap_action:
  action: more-info
hold_action:
  action: none
double_tap_action:
  action: none

Context

YAML state

Environment

- Browser: N/A
- Companion App - 2024.7.3-full
- Device: Pixel 7 Pro
- HA Version: 2024.8.2
- Mushroom: 4.0.3

Anything else?

image image

piitaya commented 2 months ago

It must be a cache issue : https://github.com/piitaya/lovelace-mushroom?tab=readme-ov-file#i-dont-see-the-last-changes

quentinwolf commented 2 months ago

I had an opposite issue with a custom template badge, where it worked fine in Firefox on my desktop, as well as the Android Companion app, but in Chrome on my desktop, I got the error

 Custom element doesn't exist: mushroom-template-badge.
type: custom:mushroom-template-badge
content: Home
icon: mdi:home
tap_action:
  action: navigate
  navigation_path: /dashboard-home/

I attempted to clear the Cache and Cookies in Chrome, logged back in, but continue to get the error. Restarted Chrome, same issue, I found it odd that it works perfectly fine in Firefox and on Android but not Chrome.

As a last resort, I went to HACS > Mushroom > and hit "Redownload" from the 3 dots at the top right corner, then hit "Download". It prompted to reload, and then it began working perfectly fine in Chrome.

Might be worth trying to re-download it to see if that fixes the issue.

milothomas commented 2 months ago

Thanks guys, re-download did the trick.