Bump simplepush to 2.1.1 (#80608)

* Update to new library version

* Remove test for removed send_encrypted function

* Bump simplepush to 2.1.1
This commit is contained in:
Timm Schäuble 2022-10-21 16:13:46 +02:00 committed by GitHub
parent 319d35626a
commit e6892a613e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 22 deletions

View File

@ -3,7 +3,7 @@ from __future__ import annotations
from typing import Any
from simplepush import UnknownError, send, send_encrypted
from simplepush import UnknownError, send
import voluptuous as vol
from homeassistant import config_entries
@ -17,15 +17,19 @@ def validate_input(entry: dict[str, str]) -> dict[str, str] | None:
"""Validate user input."""
try:
if CONF_PASSWORD in entry:
send_encrypted(
entry[CONF_DEVICE_KEY],
entry[CONF_PASSWORD],
entry[CONF_PASSWORD],
"HA test",
"Message delivered successfully",
send(
key=entry[CONF_DEVICE_KEY],
password=entry[CONF_PASSWORD],
salt=entry[CONF_PASSWORD],
title="HA test",
message="Message delivered successfully",
)
else:
send(entry[CONF_DEVICE_KEY], "HA test", "Message delivered successfully")
send(
key=entry[CONF_DEVICE_KEY],
title="HA test",
message="Message delivered successfully",
)
except UnknownError:
return {"base": "cannot_connect"}

View File

@ -2,7 +2,7 @@
"domain": "simplepush",
"name": "Simplepush",
"documentation": "https://www.home-assistant.io/integrations/simplepush",
"requirements": ["simplepush==1.1.4"],
"requirements": ["simplepush==2.1.1"],
"codeowners": ["@engrbm87"],
"config_flow": true,
"iot_class": "cloud_polling",

View File

@ -4,7 +4,7 @@ from __future__ import annotations
import logging
from typing import Any
from simplepush import BadRequest, UnknownError, send, send_encrypted
from simplepush import BadRequest, UnknownError, send
from homeassistant.components.notify import (
ATTR_DATA,
@ -71,16 +71,16 @@ class SimplePushNotificationService(BaseNotificationService):
try:
if self._password:
send_encrypted(
self._device_key,
self._password,
self._salt,
title,
message,
send(
key=self._device_key,
password=self._password,
salt=self._salt,
title=title,
message=message,
event=event,
)
else:
send(self._device_key, title, message, event=event)
send(key=self._device_key, title=title, message=message, event=event)
except BadRequest:
_LOGGER.error("Bad request. Title or message are too long")

View File

@ -2253,7 +2253,7 @@ shodan==1.28.0
simplehound==0.3
# homeassistant.components.simplepush
simplepush==1.1.4
simplepush==2.1.1
# homeassistant.components.simplisafe
simplisafe-python==2022.07.1

View File

@ -1550,7 +1550,7 @@ sharkiq==0.0.1
simplehound==0.3
# homeassistant.components.simplepush
simplepush==1.1.4
simplepush==2.1.1
# homeassistant.components.simplisafe
simplisafe-python==2022.07.1

View File

@ -29,9 +29,7 @@ def simplepush_setup_fixture():
@pytest.fixture(autouse=True)
def mock_api_request():
"""Patch simplepush api request."""
with patch("homeassistant.components.simplepush.config_flow.send"), patch(
"homeassistant.components.simplepush.config_flow.send_encrypted"
):
with patch("homeassistant.components.simplepush.config_flow.send"):
yield