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';
'''