Closed dilruacs closed 5 years ago
I was not able to find a service which would allow me to read the state of the device at these port.
The service I could find is http://10.0.0.102:50201/dial.xml but the content is static no matter if the device is powered or not.
The actual issue with this is that the requests.exceptions.ConnectionError
connection was not catched in _send_http
.
I noticed this while writing tests and changed the catch block to the base class for the requests exceptions about an hour ago.
The endless loop comes from home assistant periodically checking if the device is online.
I believe this problem exists on the current master aswell.
The version currently in your v4 branch only catches a RequestException, apparently a ConnectionError is not caught by it.
Request exception is the base for all exceptions from the requests lib which means the error is catched. http://docs.python-requests.org/en/master/_modules/requests/exceptions/
class ConnectionError(RequestException): """A Connection error occurred."""
I believe this problem exists on the current master aswell.
I do not get these stack traces when using master
Request exception is the base for all exceptions from the requests lib which means the error is catched. http://docs.python-requests.org/en/master/_modules/requests/exceptions/
class ConnectionError(RequestException): """A Connection error occurred."""
Found the cause?
def get_power_status(self):
"""Checks if the device is online."""
url = self.actionlist_url
try:
# todo parse response
self._send_http(url, HttpMethod.GET,
log_errors=False, raise_errors=True)
except requests.exceptions.HTTPError as ex:
_LOGGER.debug(ex)
return False
return True
You call _send_http()
with raise_errors=True
which explicitly causes it to throw stacktraces ;-)
Well that is obviously stupid. The RequestException should be catched in get_power_status
aswell. Thanks :)
Happens on the
v4
branchOn my BDP-S3200, only ports 50201, 50202 and 54400 are reachable when the device is powered off.
If Home Assistant is started and the device is not turned on,
/actionList
is being requested over and over again: