Equalize log messages
This commit is contained in:
parent
7ccb6b960c
commit
8796187389
3 changed files with 19 additions and 22 deletions
|
@ -23,7 +23,7 @@ DEFAULT_METHOD = 'GET'
|
|||
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=60)
|
||||
|
||||
|
||||
# pylint: disable=unused-variable
|
||||
# pylint: disable=unused-variable, logging-too-many-args
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
""" Get the REST binary sensor. """
|
||||
|
||||
|
@ -47,15 +47,14 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
response = requests.post(resource, data=payload, timeout=10,
|
||||
verify=verify_ssl)
|
||||
if not response.ok:
|
||||
_LOGGER.error('Response status is "%s"', response.status_code)
|
||||
_LOGGER.error("Response status is '%s'", response.status_code)
|
||||
return False
|
||||
except requests.exceptions.MissingSchema:
|
||||
_LOGGER.error('Missing resource or schema in configuration. '
|
||||
'Add http:// to your URL.')
|
||||
_LOGGER.error("Missing resource or schema in configuration. "
|
||||
"Add http:// or https:// to your URL")
|
||||
return False
|
||||
except requests.exceptions.ConnectionError:
|
||||
_LOGGER.error('No route to resource/endpoint: %s',
|
||||
resource)
|
||||
_LOGGER.error('No route to resource/endpoint: %s', resource)
|
||||
return False
|
||||
|
||||
if use_get:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue