Iâve updated this card a few times since first posting here. If you are using this card I recommend you to grab the latest version for much improved performance as well as new features.
Donât forget to add the new version number to the end of the cards reference url in your ui-lovelace.yaml like below.
One request if I may:- have 3 states of the icon colour so that there is another colour (perhaps red) if the device is âunavailableâ. One thing that bugs me about HAâs integration with Google Home âgroupsâ is that they sometime become unavailable for extended periods and the only way I will know is to have the icon change to a different colour.
I hope I havenât brought up something that already exists as a feature in your project since I wont know if the group is unavailable until it happensâŠ
Hey,
Normal media_player entities change state to unavailable while they canât be reached, Iâm not sure if Google Home groups does this, but they should. I then use this state information to display Unavailable on the card instead of the on/off button, like below.
Iâm so stupid, Iâve completely forgot to change the version number in that comment of the code.
That is the latest version aka v0.4.1 so youâll be fine!
Now I get this Error: https://xxx.duckdns.org/local/mini-media-player.js?ver=0.4.1:5:40 TypeError: this.createShadowRoot is not a function. (In 'this.createShadowRoot()', 'this.createShadowRoot' is undefined)
Sorry to hear that.
That is a browser compatibility issue and I think Iâve solved it with the latest release v0.5.
Please try updating, and make sure to change the version number in your ui-lovelace.yaml
Hmm⊠Make sure you have javascript_version: latest in your configuration.yaml under frontend:, then restart HA.
Is that the whole error output from the log? Can you click it and see if you get more information?
This is the whole thing, but doesnât tell you much more I guess⊠myip/local/lovelace/mini-media-player.js?1537452641.264382&v=0.5:2:8 Uncaught SyntaxError: Unexpected token {
And Iâm getting the red square with âcustom element doesnt existâ
Iâm on latest Chrome and latest javascript version.
Unrelated: I see this module has the following on the first line. Will this cause it to not work when the internet is down? If so, is there a way around it?
import { LitElement, html } from 'https://unpkg.com/@polymer/lit-element@^0.6.1/lit-element.js?module';
'''