mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
fix format
This commit is contained in:
parent
b76b002966
commit
14d0c1325c
@ -58,11 +58,9 @@ def get_service(hass, config):
|
|||||||
response = nma.get(_RESOURCE + 'verify',
|
response = nma.get(_RESOURCE + 'verify',
|
||||||
params={"apikey": config[DOMAIN][CONF_API_KEY]})
|
params={"apikey": config[DOMAIN][CONF_API_KEY]})
|
||||||
tree = ET.fromstring(response.content)
|
tree = ET.fromstring(response.content)
|
||||||
# pylint: disable=bad-option-value
|
|
||||||
if tree[0].tag == 'error':
|
if tree[0].tag == 'error':
|
||||||
_LOGGER.error(
|
_LOGGER.error("Wrong API key supplied. %s", tree[0].text)
|
||||||
"Wrong API key supplied. "
|
|
||||||
"{}".format(tree[0].text))
|
|
||||||
else:
|
else:
|
||||||
return NmaNotificationService(config[DOMAIN][CONF_API_KEY])
|
return NmaNotificationService(config[DOMAIN][CONF_API_KEY])
|
||||||
|
|
||||||
@ -93,8 +91,7 @@ class NmaNotificationService(BaseNotificationService):
|
|||||||
response = self.nma.get(_RESOURCE + 'notify',
|
response = self.nma.get(_RESOURCE + 'notify',
|
||||||
params=self._data)
|
params=self._data)
|
||||||
tree = ET.fromstring(response.content)
|
tree = ET.fromstring(response.content)
|
||||||
# pylint: disable=bad-option-value
|
|
||||||
if tree[0].tag == 'error':
|
if tree[0].tag == 'error':
|
||||||
_LOGGER.exception(
|
_LOGGER.exception(
|
||||||
"Unable to perform request. "
|
"Unable to perform request. Error: %s", tree[0].text)
|
||||||
"Error: {}".format(tree[0].text))
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user