From 0694354c7ce1a03412bccea0a1b81c02f90ac798 Mon Sep 17 00:00:00 2001 From: Anders Melchiorsen Date: Sat, 28 Jul 2018 23:55:10 +0200 Subject: [PATCH 1/2] Upgrade python-pushover to 0.5 This update removes the InitError exception. --- homeassistant/components/notify/pushover.py | 17 ++++------------- requirements_all.txt | 2 +- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/homeassistant/components/notify/pushover.py b/homeassistant/components/notify/pushover.py index 3ec0b27e7c4e0..5681740527c3c 100644 --- a/homeassistant/components/notify/pushover.py +++ b/homeassistant/components/notify/pushover.py @@ -14,7 +14,7 @@ from homeassistant.const import CONF_API_KEY import homeassistant.helpers.config_validation as cv -REQUIREMENTS = ['python-pushover==0.3'] +REQUIREMENTS = ['python-pushover==0.5'] _LOGGER = logging.getLogger(__name__) @@ -28,14 +28,8 @@ def get_service(hass, config, discovery_info=None): """Get the Pushover notification service.""" - from pushover import InitError - - try: - return PushoverNotificationService( - config[CONF_USER_KEY], config[CONF_API_KEY]) - except InitError: - _LOGGER.error("Wrong API key supplied") - return None + return PushoverNotificationService( + config[CONF_USER_KEY], config[CONF_API_KEY]) class PushoverNotificationService(BaseNotificationService): @@ -44,10 +38,7 @@ class PushoverNotificationService(BaseNotificationService): def __init__(self, user_key, api_token): """Initialize the service.""" from pushover import Client - self._user_key = user_key - self._api_token = api_token - self.pushover = Client( - self._user_key, api_token=self._api_token) + self.pushover = Client(user_key, api_token=api_token) def send_message(self, message='', **kwargs): """Send a message to a user.""" diff --git a/requirements_all.txt b/requirements_all.txt index 0bb763a3faed9..c7372ce131e7d 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1069,7 +1069,7 @@ python-nest==4.0.3 python-nmap==0.6.1 # homeassistant.components.notify.pushover -python-pushover==0.3 +python-pushover==0.5 # homeassistant.components.sensor.ripple python-ripple-api==0.0.3 From b8ffab205fc7a7a96767ae724c5d471bef170bed Mon Sep 17 00:00:00 2001 From: Anders Melchiorsen Date: Sun, 29 Jul 2018 08:31:42 +0200 Subject: [PATCH 2/2] Use temporary python-pushover fork --- homeassistant/components/notify/pushover.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/notify/pushover.py b/homeassistant/components/notify/pushover.py index 5681740527c3c..aa8338879e47e 100644 --- a/homeassistant/components/notify/pushover.py +++ b/homeassistant/components/notify/pushover.py @@ -14,7 +14,8 @@ from homeassistant.const import CONF_API_KEY import homeassistant.helpers.config_validation as cv -REQUIREMENTS = ['python-pushover==0.5'] +REQUIREMENTS = ['https://github.com/amelchio/python-pushover/archive/' + 'local-token.zip#python-pushover==0.5'] _LOGGER = logging.getLogger(__name__)