mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
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:
parent
319d35626a
commit
e6892a613e
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from simplepush import UnknownError, send, send_encrypted
|
from simplepush import UnknownError, send
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
@ -17,15 +17,19 @@ def validate_input(entry: dict[str, str]) -> dict[str, str] | None:
|
|||||||
"""Validate user input."""
|
"""Validate user input."""
|
||||||
try:
|
try:
|
||||||
if CONF_PASSWORD in entry:
|
if CONF_PASSWORD in entry:
|
||||||
send_encrypted(
|
send(
|
||||||
entry[CONF_DEVICE_KEY],
|
key=entry[CONF_DEVICE_KEY],
|
||||||
entry[CONF_PASSWORD],
|
password=entry[CONF_PASSWORD],
|
||||||
entry[CONF_PASSWORD],
|
salt=entry[CONF_PASSWORD],
|
||||||
"HA test",
|
title="HA test",
|
||||||
"Message delivered successfully",
|
message="Message delivered successfully",
|
||||||
)
|
)
|
||||||
else:
|
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:
|
except UnknownError:
|
||||||
return {"base": "cannot_connect"}
|
return {"base": "cannot_connect"}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"domain": "simplepush",
|
"domain": "simplepush",
|
||||||
"name": "Simplepush",
|
"name": "Simplepush",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/simplepush",
|
"documentation": "https://www.home-assistant.io/integrations/simplepush",
|
||||||
"requirements": ["simplepush==1.1.4"],
|
"requirements": ["simplepush==2.1.1"],
|
||||||
"codeowners": ["@engrbm87"],
|
"codeowners": ["@engrbm87"],
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"iot_class": "cloud_polling",
|
"iot_class": "cloud_polling",
|
||||||
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from simplepush import BadRequest, UnknownError, send, send_encrypted
|
from simplepush import BadRequest, UnknownError, send
|
||||||
|
|
||||||
from homeassistant.components.notify import (
|
from homeassistant.components.notify import (
|
||||||
ATTR_DATA,
|
ATTR_DATA,
|
||||||
@ -71,16 +71,16 @@ class SimplePushNotificationService(BaseNotificationService):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if self._password:
|
if self._password:
|
||||||
send_encrypted(
|
send(
|
||||||
self._device_key,
|
key=self._device_key,
|
||||||
self._password,
|
password=self._password,
|
||||||
self._salt,
|
salt=self._salt,
|
||||||
title,
|
title=title,
|
||||||
message,
|
message=message,
|
||||||
event=event,
|
event=event,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
send(self._device_key, title, message, event=event)
|
send(key=self._device_key, title=title, message=message, event=event)
|
||||||
|
|
||||||
except BadRequest:
|
except BadRequest:
|
||||||
_LOGGER.error("Bad request. Title or message are too long")
|
_LOGGER.error("Bad request. Title or message are too long")
|
||||||
|
@ -2253,7 +2253,7 @@ shodan==1.28.0
|
|||||||
simplehound==0.3
|
simplehound==0.3
|
||||||
|
|
||||||
# homeassistant.components.simplepush
|
# homeassistant.components.simplepush
|
||||||
simplepush==1.1.4
|
simplepush==2.1.1
|
||||||
|
|
||||||
# homeassistant.components.simplisafe
|
# homeassistant.components.simplisafe
|
||||||
simplisafe-python==2022.07.1
|
simplisafe-python==2022.07.1
|
||||||
|
@ -1550,7 +1550,7 @@ sharkiq==0.0.1
|
|||||||
simplehound==0.3
|
simplehound==0.3
|
||||||
|
|
||||||
# homeassistant.components.simplepush
|
# homeassistant.components.simplepush
|
||||||
simplepush==1.1.4
|
simplepush==2.1.1
|
||||||
|
|
||||||
# homeassistant.components.simplisafe
|
# homeassistant.components.simplisafe
|
||||||
simplisafe-python==2022.07.1
|
simplisafe-python==2022.07.1
|
||||||
|
@ -29,9 +29,7 @@ def simplepush_setup_fixture():
|
|||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def mock_api_request():
|
def mock_api_request():
|
||||||
"""Patch simplepush api request."""
|
"""Patch simplepush api request."""
|
||||||
with patch("homeassistant.components.simplepush.config_flow.send"), patch(
|
with patch("homeassistant.components.simplepush.config_flow.send"):
|
||||||
"homeassistant.components.simplepush.config_flow.send_encrypted"
|
|
||||||
):
|
|
||||||
yield
|
yield
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user