* Fix digest auth rest sensors
* Refactor to use request()
* Fix black complaints
* Don't rename data variable
Don't rename the data variable, appears several other sensors have been coded to rely on it
* Fix tests
test_setup_missing_schema:
Change the exception to check for to PlatformNotReady. With the change away from prepared statements, we no longer get the MissingSchema error during setup - we get it when we attempt to call the endpoint. Since the result is PlatformNotReady, which is what we want, and the error log clearly contains a note that the schema is incorrect I think this is fine.
test_setup_failed_connect & test_setup_timeout:
These aren't checking for minimum config, and they're not invoking the correct method to have the default config filled in. Therefore I've just added the correct minimum config so these can continue to test what they're there to test.
test_update_request_exception:
Testing a request exception with the assert on line 404! Excellent. Anyway, we've moved from using the requests Session object to the requests.request function - so the patch needed to be altered to ensure the RequestException was raised.
* Remove no longer needed import
* Fix binary sensor test in same way