Change apns service domain and remove unused variable (#29165)
* change apns service domain and remove unused variable * fix tests * move DOMAIN to const.py and import DEVICE_TRACKER_DOMAIN from base componentpull/29165/merge
parent
bdb3eb1683
commit
b6d94bcc96
|
@ -0,0 +1,2 @@
|
|||
"""Constants for the apns component."""
|
||||
DOMAIN = "apns"
|
|
@ -9,7 +9,6 @@ import voluptuous as vol
|
|||
from homeassistant.components.notify import (
|
||||
ATTR_DATA,
|
||||
ATTR_TARGET,
|
||||
DOMAIN,
|
||||
PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
|
@ -18,13 +17,14 @@ from homeassistant.const import ATTR_NAME, CONF_NAME, CONF_PLATFORM
|
|||
from homeassistant.helpers import template as template_helper
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.event import track_state_change
|
||||
from homeassistant.components.device_tracker import DOMAIN as DEVICE_TRACKER_DOMAIN
|
||||
|
||||
from .const import DOMAIN
|
||||
|
||||
APNS_DEVICES = "apns.yaml"
|
||||
CONF_CERTFILE = "cert_file"
|
||||
CONF_TOPIC = "topic"
|
||||
CONF_SANDBOX = "sandbox"
|
||||
DEVICE_TRACKER_DOMAIN = "device_tracker"
|
||||
SERVICE_REGISTER = "apns_register"
|
||||
|
||||
ATTR_PUSH_ID = "push_id"
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ class TestApns(unittest.TestCase):
|
|||
self._setup_notify()
|
||||
|
||||
assert self.hass.services.call(
|
||||
notify.DOMAIN,
|
||||
apns.DOMAIN,
|
||||
"apns_test_app",
|
||||
{"push_id": "1234", "name": "test device"},
|
||||
blocking=True,
|
||||
|
@ -153,7 +153,7 @@ class TestApns(unittest.TestCase):
|
|||
self._setup_notify()
|
||||
|
||||
assert self.hass.services.call(
|
||||
notify.DOMAIN, "apns_test_app", {"push_id": "1234"}, blocking=True
|
||||
apns.DOMAIN, "apns_test_app", {"push_id": "1234"}, blocking=True
|
||||
)
|
||||
|
||||
devices = {dev.push_id: dev for dev in written_devices}
|
||||
|
@ -183,7 +183,7 @@ class TestApns(unittest.TestCase):
|
|||
self._setup_notify()
|
||||
|
||||
assert self.hass.services.call(
|
||||
notify.DOMAIN,
|
||||
apns.DOMAIN,
|
||||
"apns_test_app",
|
||||
{"push_id": "1234", "name": "updated device 1"},
|
||||
blocking=True,
|
||||
|
@ -222,7 +222,7 @@ class TestApns(unittest.TestCase):
|
|||
self._setup_notify()
|
||||
|
||||
assert self.hass.services.call(
|
||||
notify.DOMAIN,
|
||||
apns.DOMAIN,
|
||||
"apns_test_app",
|
||||
{"push_id": "1234", "name": "updated device 1"},
|
||||
blocking=True,
|
||||
|
|
Loading…
Reference in New Issue