robert-alfaro / genius-lyrics

Home Assistant custom component for fetching song lyrics from Genius.com
23 stars 7 forks source link

error calling service #8

Closed jbarneson closed 4 years ago

jbarneson commented 4 years ago

first -- awesome custom component. I was just going to sit down and write one myself and saw yours! Excited to get it up and running...

I have the component added and configuration in place -- on restart the "lyrics sensor" is auto created, but when a new song is started, the lyrics remain "null". Artist and Title attributes populate on the "lyrics sensor", but the lyrics do not.

In the logs, each new song invokes this error: "Missing artist and/or title", but like i noted above, the sensor does have correct information pulled from the media_player.

When I try and invoke the service from dev tools with the example JSON data in github ("Mind of a King"), I get a different error: "search_lyrics. 'bool' object is not callable":

Failed to call service genius_lyrics/search_lyrics. 'bool' object is not callable
'bool' object is not callable
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 133, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1236, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1263, in _execute_service
    await self._hass.async_add_executor_job(handler.func, service_call)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
TypeError: 'bool' object is not callable
robert-alfaro commented 4 years ago

I clearly broke something in my last commit.. I'll be attempting to fix very soon.

Are you using the tracking functionality or setting up an automation to call the service?

Thanks!

robert-alfaro commented 4 years ago

@jbarneson all should be good now :)