FYI, if anyone is on Home Assistant .91 or greater you need to change a line of code in your switch.py file. On line 17 change:
from homeassistant.components.sensor.rest import RestData
to
from homeassistant.components.rest.sensor import RestData
I was getting an error that it could not find homeassistant.components.sensor.rest and that gmusic would not load. Changing it like above fixed my issues.
I thought I had a workaround for the Config Entry errors.
Removing those entries from gmusic.yaml and instead adding them to gmusic/switch.py did in fact stop the warning message and GM continued to work through 91.4
Today I upgraded to HA 92.0 and unfortunately the GM custom switch now prevents HA from starting.
Iām still not receiving any error messages but HA just hangs about halfway through startup. Removing the GM switch resolves the issue and HA starts as expected. I was not expecting this to be a breaking change until next release.
Iām fairly certain weāll be able to keep Google Music in Home Assistant one way or another. I have
the (appdaemon version) working in a virtualenv and on my hass.io virtual machine. I donāt normally use hass.io so itās taking a little help from others to get the bugs out
I hope you still consider to have a look at my expanded appdaemon version of this in the future.
Iāve just put the files on GitHub and updated this post with all the linksā¦
In other news I also have this custom_compent working in Home Assistant 92.1
@troy, interestingly, the custom component is able to turn on and play music, but it doesnāt seem able to turn it off? On 0.92.2. When I toggle the switch off, nothing happens and music continues to play. And thank you so much for doing great work on this component!
@tc23 Did it work differently before? I just added the extra files, I did not really change any code in the component. It could be related to the missing previous next controls.
I have my appdaemon version of this working very well now. Iām starting to work on creating a new custom component for this. I just need to figure out if this should be a new custom component or if it should be a new platform for the media player component.
In the prior custom component, it stopped the music as well. But itās alright, I just added a node red automation to turn off the respective Media players when the switch turns off. Iāll probably switch over to the appdaemon, but needed the custom component for the interim.
Iām not seeing the media player turn off when the switch is turned off. I see @tc23 added this in a script but not in the code? Maybe Iām missing it.