-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error - Unable to serialize to JSON: Object of type coroutine is not JSON serializable #302
Comments
Need more log context to know but initially we don't actually use the websocket_api component so I don't think it's coming from us. It is referencing an event we are publishing though. Are you selecting a media source when this happens? |
Error occurs multiple times through out the day when I actually am not home. So I wasn`t selecting media source. And most of the occurrences are like: |
The worst part is that homeassistant lovelace interface hangs on "loading data" screen. |
Do you have debugging enabled for the component? That may help to determine if the component is having the issue. If disabling alexa_media doesn't help, the json error you're seeing looks related to the Recorder so it may be that the recorder is crashing because of the malformed data and is causing the issue too. |
No I don`t have debugging enabled. Could you link to somewhere how can I enable? Anyway, this bit of info |
Yes, the event is generated by alexa_media. Not clear though that the alexa_media component is actually crashing. It looks like HA may have a bug in Regardless, there is a bug in our state generation and I've fixed it in #303. Can you please manually replace the file and let me know if the issue is resolved? |
Done, will get back with updates. |
I get this |
Oops. Ok, can you please delete the await from line 199 in the media_player. Should look like: Before: await self.async_schedule_update_ha_state() After: self.async_schedule_update_ha_state() |
yea. this seems to work now. |
Ok, this is a different bug and I'll open up a new issue to address. I'll have a new question for you in the new issue. Can you please go answer it there? |
Sure, will do that once I get back home. Thanks for fixing the issue. |
fix(media_player): set await for async source functions
Nice, I finally figured out why my lovelace hangs :) So awesome you were able to fix it so fast, thanks alandtse! |
Hi, I`m not sure this is alexa_media related but it looks like so.
I get this error:
Version 2.0
ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1827548752] Unable to serialize to JSON: Object of type coroutine is not JSON serializable {'id': 2, 'type': 'event', 'event': {'event_type': 'state_changed', 'data': {'entity_id': 'media_player.daniel_s_echo_dot', 'old_state': <state media_player.daniel_s_echo_dot=standby; is_volume_muted=False, media_content_type=standby, media_position_updated_at=2019-08-25T23:11:45.106361+03:00, source=Ugreen-Bluetooth05, source_list=['Local Speaker'], available=True, last_called=True, friendly_name=Daniel's Echo Dot, supported_features=56253 @ 2019-08-26T10:25:47.559961+03:00>, 'new_state': <state media_player.daniel_s_echo_dot=standby; is_volume_muted=False, media_content_type=standby, media_position_updated_at=2019-08-25T23:11:45.106361+03:00, source=<coroutine object AlexaClient._get_source at 0x72b620c0>, source_list=<coroutine object AlexaClient._get_source_list at 0x6f0efd68>, available=True, last_called=True, friendly_name=Daniel's Echo Dot, supported_features=56253 @ 2019-08-26T10:25:47.559961+03:00>}, 'origin': 'LOCAL', 'time_fired': datetime.datetime(2019, 8, 26, 8, 1, 49, 181128, tzinfo=<UTC>), 'context': {'id': '715f4156742e4a23beb612ccf57fdf5e', 'parent_id': None, 'user_id': None}}}
The text was updated successfully, but these errors were encountered: