home-assistant-libs / pychromecast

Library for Python 3 to communicate with the Google Chromecast.
MIT License
2.53k stars 376 forks source link

Make optional callback functions kwarg only #779

Closed emontnemery closed 8 months ago

emontnemery commented 8 months ago

Breaking change

Most user facing functions accepting an optional callback function have been changed such that the optional arguments are now kwarg only

Change

Make optional callback functions kwarg only

Background

This is the first step in refactoring the callback functions to accept a bool status and an optional response.

Refactoring the callback handling is needed because callbacks are currently only called if the request suceeds; there's no call if the request fails. This means any user relying on callbacks will hang forever or until a timeout when the request fails.

emontnemery commented 8 months ago

Is this a breaking change for users of the library?

What's the reason for that goal?

callback functions to accept a bool status and an optional response

Thanks Martin, the PR has been updated with this information

MartinHjelmare commented 8 months ago

I fixed a typo.