Great migration notify (#22406)

* Move notify platforms into components

* Move notify tests

* Fix notify tests

* More fixes

* Update requirements

* Update .coveragerc

* Run gen reqs
This commit is contained in:
Robbie Trencheny 2019-03-27 20:36:13 -07:00 committed by Paulus Schoutsen
parent 92457ca5ca
commit 7741ec4d5a
105 changed files with 653 additions and 582 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
"""The apns component."""

View file

@ -15,7 +15,7 @@ from homeassistant.helpers import template as template_helper
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import track_state_change from homeassistant.helpers.event import track_state_change
from . import ( from homeassistant.components.notify import (
ATTR_DATA, ATTR_TARGET, DOMAIN, PLATFORM_SCHEMA, BaseNotificationService) ATTR_DATA, ATTR_TARGET, DOMAIN, PLATFORM_SCHEMA, BaseNotificationService)
REQUIREMENTS = ['apns2==0.3.0'] REQUIREMENTS = ['apns2==0.3.0']

View file

@ -0,0 +1 @@
"""The aws_lambda component."""

View file

@ -14,7 +14,8 @@ from homeassistant.const import CONF_NAME, CONF_PLATFORM
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.json import JSONEncoder from homeassistant.helpers.json import JSONEncoder
from . import ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (ATTR_TARGET, PLATFORM_SCHEMA,
BaseNotificationService)
REQUIREMENTS = ['boto3==1.9.16'] REQUIREMENTS = ['boto3==1.9.16']

View file

@ -0,0 +1 @@
"""The aws_sns component."""

View file

@ -12,7 +12,7 @@ import voluptuous as vol
from homeassistant.const import CONF_NAME, CONF_PLATFORM from homeassistant.const import CONF_NAME, CONF_PLATFORM
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ( from homeassistant.components.notify import (
ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA,
BaseNotificationService) BaseNotificationService)

View file

@ -0,0 +1 @@
"""The aws_sqs component."""

View file

@ -12,7 +12,8 @@ import voluptuous as vol
from homeassistant.const import CONF_NAME, CONF_PLATFORM from homeassistant.const import CONF_NAME, CONF_PLATFORM
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (ATTR_TARGET, PLATFORM_SCHEMA,
BaseNotificationService)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ["boto3==1.9.16"] REQUIREMENTS = ["boto3==1.9.16"]

View file

@ -0,0 +1 @@
"""The ciscospark component."""

View file

@ -11,7 +11,8 @@ import voluptuous as vol
from homeassistant.const import CONF_TOKEN from homeassistant.const import CONF_TOKEN
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ATTR_TITLE, PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (ATTR_TITLE, PLATFORM_SCHEMA,
BaseNotificationService)
REQUIREMENTS = ['ciscosparkapi==0.4.2'] REQUIREMENTS = ['ciscosparkapi==0.4.2']

View file

@ -0,0 +1 @@
"""The clickatell component."""

View file

@ -12,7 +12,8 @@ import voluptuous as vol
from homeassistant.const import CONF_API_KEY, CONF_RECIPIENT from homeassistant.const import CONF_API_KEY, CONF_RECIPIENT
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (PLATFORM_SCHEMA,
BaseNotificationService)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -0,0 +1 @@
"""The clicksend component."""

View file

@ -16,7 +16,8 @@ from homeassistant.const import (
CONTENT_TYPE_JSON) CONTENT_TYPE_JSON)
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (PLATFORM_SCHEMA,
BaseNotificationService)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -0,0 +1 @@
"""The clicksend_tts component."""

View file

@ -17,7 +17,8 @@ from homeassistant.const import (
CONF_API_KEY, CONF_RECIPIENT, CONF_USERNAME, CONTENT_TYPE_JSON) CONF_API_KEY, CONF_RECIPIENT, CONF_USERNAME, CONTENT_TYPE_JSON)
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (PLATFORM_SCHEMA,
BaseNotificationService)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -12,7 +12,8 @@ import voluptuous as vol
from homeassistant.const import CONF_COMMAND, CONF_NAME from homeassistant.const import CONF_COMMAND, CONF_NAME
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (PLATFORM_SCHEMA,
BaseNotificationService)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -4,7 +4,7 @@ Demo notification service.
For more details about this platform, please refer to the documentation For more details about this platform, please refer to the documentation
https://home-assistant.io/components/demo/ https://home-assistant.io/components/demo/
""" """
from . import BaseNotificationService from homeassistant.components.notify import BaseNotificationService
EVENT_NOTIFY = "notify" EVENT_NOTIFY = "notify"

View file

@ -0,0 +1 @@
"""The discord component."""

View file

@ -11,7 +11,9 @@ import voluptuous as vol
from homeassistant.const import CONF_TOKEN from homeassistant.const import CONF_TOKEN
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ATTR_DATA, ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (ATTR_DATA, ATTR_TARGET,
PLATFORM_SCHEMA,
BaseNotificationService)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -0,0 +1 @@
"""The facebook component."""

View file

@ -14,7 +14,9 @@ import voluptuous as vol
from homeassistant.const import CONTENT_TYPE_JSON from homeassistant.const import CONTENT_TYPE_JSON
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ATTR_DATA, ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (ATTR_DATA, ATTR_TARGET,
PLATFORM_SCHEMA,
BaseNotificationService)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -13,7 +13,7 @@ from homeassistant.const import CONF_FILENAME
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
import homeassistant.util.dt as dt_util import homeassistant.util.dt as dt_util
from . import ( from homeassistant.components.notify import (
ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService) ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService)
CONF_TIMESTAMP = 'timestamp' CONF_TIMESTAMP = 'timestamp'

View file

@ -0,0 +1 @@
"""The flock component."""

View file

@ -14,7 +14,8 @@ from homeassistant.const import CONF_ACCESS_TOKEN
from homeassistant.helpers.aiohttp_client import async_get_clientsession from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (PLATFORM_SCHEMA,
BaseNotificationService)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
_RESOURCE = 'https://api.flock.com/hooks/sendMessage/' _RESOURCE = 'https://api.flock.com/hooks/sendMessage/'

View file

@ -0,0 +1 @@
"""The free_mobile component."""

View file

@ -11,7 +11,8 @@ import voluptuous as vol
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_USERNAME from homeassistant.const import CONF_ACCESS_TOKEN, CONF_USERNAME
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (PLATFORM_SCHEMA,
BaseNotificationService)
REQUIREMENTS = ['freesms==0.1.2'] REQUIREMENTS = ['freesms==0.1.2']

View file

@ -0,0 +1 @@
"""The gntp component."""

View file

@ -12,7 +12,7 @@ import voluptuous as vol
from homeassistant.const import CONF_PASSWORD, CONF_PORT from homeassistant.const import CONF_PASSWORD, CONF_PORT
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ( from homeassistant.components.notify import (
ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService) ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService)
REQUIREMENTS = ['gntp==1.0.3'] REQUIREMENTS = ['gntp==1.0.3']

View file

@ -14,7 +14,7 @@ import voluptuous as vol
from homeassistant.const import ATTR_SERVICE from homeassistant.const import ATTR_SERVICE
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ( from homeassistant.components.notify import (
ATTR_DATA, ATTR_MESSAGE, DOMAIN, PLATFORM_SCHEMA, BaseNotificationService) ATTR_DATA, ATTR_MESSAGE, DOMAIN, PLATFORM_SCHEMA, BaseNotificationService)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -0,0 +1 @@
"""The hipchat component."""

View file

@ -11,7 +11,9 @@ import voluptuous as vol
from homeassistant.const import CONF_HOST, CONF_ROOM, CONF_TOKEN from homeassistant.const import CONF_HOST, CONF_ROOM, CONF_TOKEN
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ATTR_DATA, ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (ATTR_DATA, ATTR_TARGET,
PLATFORM_SCHEMA,
BaseNotificationService)
REQUIREMENTS = ['hipnotify==1.0.8'] REQUIREMENTS = ['hipnotify==1.0.8']

View file

@ -0,0 +1 @@
"""The html5 component."""

View file

@ -25,7 +25,7 @@ from homeassistant.helpers import config_validation as cv
from homeassistant.util import ensure_unique_string from homeassistant.util import ensure_unique_string
from homeassistant.util.json import load_json, save_json from homeassistant.util.json import load_json, save_json
from . import ( from homeassistant.components.notify import (
ATTR_DATA, ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, DOMAIN, ATTR_DATA, ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, DOMAIN,
PLATFORM_SCHEMA, BaseNotificationService) PLATFORM_SCHEMA, BaseNotificationService)

View file

@ -15,7 +15,7 @@ from homeassistant.const import (
from homeassistant.helpers.aiohttp_client import async_get_clientsession from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ( from homeassistant.components.notify import (
ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA,
BaseNotificationService) BaseNotificationService)

View file

@ -0,0 +1 @@
"""The lannouncer component."""

View file

@ -13,7 +13,8 @@ import voluptuous as vol
from homeassistant.const import CONF_HOST, CONF_PORT from homeassistant.const import CONF_HOST, CONF_PORT
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ATTR_DATA, PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (ATTR_DATA, PLATFORM_SCHEMA,
BaseNotificationService)
ATTR_METHOD = 'method' ATTR_METHOD = 'method'
ATTR_METHOD_DEFAULT = 'speak' ATTR_METHOD_DEFAULT = 'speak'

View file

@ -0,0 +1 @@
"""The llamalab_automate component."""

View file

@ -12,7 +12,8 @@ import voluptuous as vol
from homeassistant.const import CONF_API_KEY, CONF_DEVICE from homeassistant.const import CONF_API_KEY, CONF_DEVICE
from homeassistant.helpers import config_validation as cv from homeassistant.helpers import config_validation as cv
from . import PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (PLATFORM_SCHEMA,
BaseNotificationService)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
_RESOURCE = 'https://llamalab.com/automate/cloud/message' _RESOURCE = 'https://llamalab.com/automate/cloud/message'

View file

@ -0,0 +1 @@
"""The mastodon component."""

View file

@ -11,7 +11,8 @@ import voluptuous as vol
from homeassistant.const import CONF_ACCESS_TOKEN from homeassistant.const import CONF_ACCESS_TOKEN
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (PLATFORM_SCHEMA,
BaseNotificationService)
REQUIREMENTS = ['Mastodon.py==1.3.1'] REQUIREMENTS = ['Mastodon.py==1.3.1']

View file

@ -0,0 +1 @@
"""The message_bird component."""

View file

@ -11,7 +11,8 @@ import voluptuous as vol
from homeassistant.const import CONF_API_KEY, CONF_SENDER from homeassistant.const import CONF_API_KEY, CONF_SENDER
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (ATTR_TARGET, PLATFORM_SCHEMA,
BaseNotificationService)
REQUIREMENTS = ['messagebird==1.2.0'] REQUIREMENTS = ['messagebird==1.2.0']

View file

@ -6,7 +6,7 @@ https://home-assistant.io/components/notify.mycroft/
""" """
import logging import logging
from . import BaseNotificationService from homeassistant.components.notify import BaseNotificationService
DEPENDENCIES = ['mycroft'] DEPENDENCIES = ['mycroft']

View file

@ -0,0 +1 @@
"""The nfandroidtv component."""

View file

@ -15,7 +15,7 @@ import voluptuous as vol
from homeassistant.const import CONF_TIMEOUT, CONF_HOST from homeassistant.const import CONF_TIMEOUT, CONF_HOST
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ( from homeassistant.components.notify import (
ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA,
BaseNotificationService) BaseNotificationService)

View file

@ -0,0 +1 @@
"""The prowl component."""

View file

@ -14,7 +14,7 @@ from homeassistant.const import CONF_API_KEY
from homeassistant.helpers.aiohttp_client import async_get_clientsession from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ( from homeassistant.components.notify import (
ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA,
BaseNotificationService) BaseNotificationService)

View file

@ -12,7 +12,7 @@ import voluptuous as vol
from homeassistant.const import CONF_API_KEY from homeassistant.const import CONF_API_KEY
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ( from homeassistant.components.notify import (
ATTR_DATA, ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, ATTR_DATA, ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA,
BaseNotificationService) BaseNotificationService)

View file

@ -0,0 +1 @@
"""The pushetta component."""

View file

@ -11,7 +11,7 @@ import voluptuous as vol
from homeassistant.const import CONF_API_KEY from homeassistant.const import CONF_API_KEY
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ( from homeassistant.components.notify import (
ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService) ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -0,0 +1 @@
"""The pushover component."""

View file

@ -11,7 +11,7 @@ import voluptuous as vol
from homeassistant.const import CONF_API_KEY from homeassistant.const import CONF_API_KEY
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ( from homeassistant.components.notify import (
ATTR_DATA, ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, ATTR_DATA, ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA,
BaseNotificationService) BaseNotificationService)

View file

@ -0,0 +1 @@
"""The pushsafer component."""

View file

@ -14,7 +14,7 @@ import voluptuous as vol
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ( from homeassistant.components.notify import (
ATTR_DATA, ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, ATTR_DATA, ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA,
BaseNotificationService) BaseNotificationService)

View file

@ -15,7 +15,7 @@ from homeassistant.const import (
HTTP_DIGEST_AUTHENTICATION) HTTP_DIGEST_AUTHENTICATION)
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ( from homeassistant.components.notify import (
ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA,
BaseNotificationService) BaseNotificationService)

View file

@ -0,0 +1 @@
"""The rocketchat component."""

View file

@ -12,7 +12,8 @@ from homeassistant.const import (
CONF_PASSWORD, CONF_ROOM, CONF_URL, CONF_USERNAME) CONF_PASSWORD, CONF_ROOM, CONF_URL, CONF_USERNAME)
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ATTR_DATA, PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (ATTR_DATA, PLATFORM_SCHEMA,
BaseNotificationService)
REQUIREMENTS = ['rocketchat-API==0.6.1'] REQUIREMENTS = ['rocketchat-API==0.6.1']

View file

@ -0,0 +1 @@
"""The sendgrid component."""

View file

@ -12,7 +12,7 @@ from homeassistant.const import (
CONF_API_KEY, CONF_RECIPIENT, CONF_SENDER, CONTENT_TYPE_TEXT_PLAIN) CONF_API_KEY, CONF_RECIPIENT, CONF_SENDER, CONTENT_TYPE_TEXT_PLAIN)
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ( from homeassistant.components.notify import (
ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService) ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService)
REQUIREMENTS = ['sendgrid==5.6.0'] REQUIREMENTS = ['sendgrid==5.6.0']

View file

@ -0,0 +1 @@
"""The simplepush component."""

View file

@ -11,7 +11,7 @@ import voluptuous as vol
from homeassistant.const import CONF_PASSWORD from homeassistant.const import CONF_PASSWORD
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ( from homeassistant.components.notify import (
ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService) ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService)
REQUIREMENTS = ['simplepush==1.1.4'] REQUIREMENTS = ['simplepush==1.1.4']

View file

@ -0,0 +1 @@
"""The slack component."""

View file

@ -13,7 +13,7 @@ import voluptuous as vol
from homeassistant.const import CONF_API_KEY, CONF_ICON, CONF_USERNAME from homeassistant.const import CONF_API_KEY, CONF_ICON, CONF_USERNAME
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ( from homeassistant.components.notify import (
ATTR_DATA, ATTR_TARGET, ATTR_TITLE, PLATFORM_SCHEMA, ATTR_DATA, ATTR_TARGET, ATTR_TITLE, PLATFORM_SCHEMA,
BaseNotificationService) BaseNotificationService)

View file

@ -0,0 +1 @@
"""The smtp component."""

View file

@ -21,7 +21,7 @@ from homeassistant.const import (
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
import homeassistant.util.dt as dt_util import homeassistant.util.dt as dt_util
from . import ( from homeassistant.components.notify import (
ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA,
BaseNotificationService) BaseNotificationService)

View file

@ -0,0 +1 @@
"""The stride component."""

View file

@ -11,7 +11,9 @@ import voluptuous as vol
from homeassistant.const import CONF_ROOM, CONF_TOKEN from homeassistant.const import CONF_ROOM, CONF_TOKEN
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ATTR_DATA, ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (ATTR_DATA, ATTR_TARGET,
PLATFORM_SCHEMA,
BaseNotificationService)
REQUIREMENTS = ['pystride==0.1.7'] REQUIREMENTS = ['pystride==0.1.7']

View file

@ -0,0 +1 @@
"""The synology_chat component."""

View file

@ -13,7 +13,8 @@ import voluptuous as vol
from homeassistant.const import CONF_RESOURCE, CONF_VERIFY_SSL from homeassistant.const import CONF_RESOURCE, CONF_VERIFY_SSL
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ATTR_DATA, PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (ATTR_DATA, PLATFORM_SCHEMA,
BaseNotificationService)
ATTR_FILE_URL = 'file_url' ATTR_FILE_URL = 'file_url'

View file

@ -0,0 +1 @@
"""The syslog component."""

View file

@ -8,7 +8,7 @@ import logging
import voluptuous as vol import voluptuous as vol
from . import ( from homeassistant.components.notify import (
ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService) ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -0,0 +1 @@
"""The telegram component."""

View file

@ -10,7 +10,7 @@ import voluptuous as vol
from homeassistant.const import ATTR_LOCATION from homeassistant.const import ATTR_LOCATION
from . import ( from homeassistant.components.notify import (
ATTR_DATA, ATTR_MESSAGE, ATTR_TARGET, ATTR_TITLE, PLATFORM_SCHEMA, ATTR_DATA, ATTR_MESSAGE, ATTR_TARGET, ATTR_TITLE, PLATFORM_SCHEMA,
BaseNotificationService) BaseNotificationService)

View file

@ -0,0 +1 @@
"""The twilio_call component."""

View file

@ -12,7 +12,8 @@ import voluptuous as vol
from homeassistant.components.twilio import DATA_TWILIO from homeassistant.components.twilio import DATA_TWILIO
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (ATTR_TARGET, PLATFORM_SCHEMA,
BaseNotificationService)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -0,0 +1 @@
"""The twilio_sms component."""

View file

@ -11,7 +11,8 @@ import voluptuous as vol
from homeassistant.components.twilio import DATA_TWILIO from homeassistant.components.twilio import DATA_TWILIO
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (ATTR_TARGET, PLATFORM_SCHEMA,
BaseNotificationService)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ["twilio"] DEPENDENCIES = ["twilio"]

View file

@ -0,0 +1 @@
"""The twitter component."""

View file

@ -17,7 +17,8 @@ from homeassistant.const import CONF_ACCESS_TOKEN, CONF_USERNAME
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import async_track_point_in_time from homeassistant.helpers.event import async_track_point_in_time
from . import ATTR_DATA, PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (ATTR_DATA, PLATFORM_SCHEMA,
BaseNotificationService)
REQUIREMENTS = ['TwitterAPI==2.5.9'] REQUIREMENTS = ['TwitterAPI==2.5.9']

View file

@ -0,0 +1 @@
"""The xmpp component."""

View file

@ -19,7 +19,7 @@ from homeassistant.const import (
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
import homeassistant.helpers.template as template_helper import homeassistant.helpers.template as template_helper
from . import ( from homeassistant.components.notify import (
ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService) ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService)
REQUIREMENTS = ['slixmpp==1.4.2'] REQUIREMENTS = ['slixmpp==1.4.2']

View file

@ -0,0 +1 @@
"""The yessssms component."""

View file

@ -11,7 +11,8 @@ import voluptuous as vol
from homeassistant.const import CONF_PASSWORD, CONF_RECIPIENT, CONF_USERNAME from homeassistant.const import CONF_PASSWORD, CONF_RECIPIENT, CONF_USERNAME
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import PLATFORM_SCHEMA, BaseNotificationService from homeassistant.components.notify import (PLATFORM_SCHEMA,
BaseNotificationService)
REQUIREMENTS = ['YesssSMS==0.2.3'] REQUIREMENTS = ['YesssSMS==0.2.3']

View file

@ -35,7 +35,7 @@ Adafruit-SHT31==1.0.2
# homeassistant.components.homekit # homeassistant.components.homekit
HAP-python==2.4.2 HAP-python==2.4.2
# homeassistant.components.notify.mastodon # homeassistant.components.mastodon.notify
Mastodon.py==1.3.1 Mastodon.py==1.3.1
# homeassistant.components.github.sensor # homeassistant.components.github.sensor
@ -78,7 +78,7 @@ RtmAPI==0.7.0
# homeassistant.components.travisci.sensor # homeassistant.components.travisci.sensor
TravisPy==0.3.5 TravisPy==0.3.5
# homeassistant.components.notify.twitter # homeassistant.components.twitter.notify
TwitterAPI==2.5.9 TwitterAPI==2.5.9
# homeassistant.components.tof.sensor # homeassistant.components.tof.sensor
@ -87,7 +87,7 @@ TwitterAPI==2.5.9
# homeassistant.components.waze_travel_time.sensor # homeassistant.components.waze_travel_time.sensor
WazeRouteCalculator==0.9 WazeRouteCalculator==0.9
# homeassistant.components.notify.yessssms # homeassistant.components.yessssms.notify
YesssSMS==0.2.3 YesssSMS==0.2.3
# homeassistant.components.abode # homeassistant.components.abode
@ -169,7 +169,7 @@ anthemav==1.1.10
# homeassistant.components.apcupsd # homeassistant.components.apcupsd
apcaccess==0.0.13 apcaccess==0.0.13
# homeassistant.components.notify.apns # homeassistant.components.apns.notify
apns2==0.3.0 apns2==0.3.0
# homeassistant.components.aqualogic # homeassistant.components.aqualogic
@ -230,9 +230,9 @@ blockchain==1.4.4
# bme680==1.0.5 # bme680==1.0.5
# homeassistant.components.route53 # homeassistant.components.route53
# homeassistant.components.notify.aws_lambda # homeassistant.components.aws_lambda.notify
# homeassistant.components.notify.aws_sns # homeassistant.components.aws_sns.notify
# homeassistant.components.notify.aws_sqs # homeassistant.components.aws_sqs.notify
boto3==1.9.16 boto3==1.9.16
# homeassistant.scripts.credstash # homeassistant.scripts.credstash
@ -270,7 +270,7 @@ caldav==0.5.0
# homeassistant.components.cisco_mobility_express.device_tracker # homeassistant.components.cisco_mobility_express.device_tracker
ciscomobilityexpress==0.1.5 ciscomobilityexpress==0.1.5
# homeassistant.components.notify.ciscospark # homeassistant.components.ciscospark.notify
ciscosparkapi==0.4.2 ciscosparkapi==0.4.2
# homeassistant.components.cppm_tracker.device_tracker # homeassistant.components.cppm_tracker.device_tracker
@ -341,7 +341,7 @@ directpy==0.5
# homeassistant.components.discogs.sensor # homeassistant.components.discogs.sensor
discogs_client==2.2.1 discogs_client==2.2.1
# homeassistant.components.notify.discord # homeassistant.components.discord.notify
discord.py==0.16.12 discord.py==0.16.12
# homeassistant.components.updater # homeassistant.components.updater
@ -443,7 +443,7 @@ flux_led==0.22
# homeassistant.components.foobot.sensor # homeassistant.components.foobot.sensor
foobot_async==0.3.1 foobot_async==0.3.1
# homeassistant.components.notify.free_mobile # homeassistant.components.free_mobile.notify
freesms==0.1.2 freesms==0.1.2
# homeassistant.components.fritz.device_tracker # homeassistant.components.fritz.device_tracker
@ -477,7 +477,7 @@ gitterpy==0.1.7
# homeassistant.components.glances.sensor # homeassistant.components.glances.sensor
glances_api==0.2.0 glances_api==0.2.0
# homeassistant.components.notify.gntp # homeassistant.components.gntp.notify
gntp==1.0.3 gntp==1.0.3
# homeassistant.components.google # homeassistant.components.google
@ -531,7 +531,7 @@ heatmiserV3==0.9.1
# homeassistant.components.hikvisioncam.switch # homeassistant.components.hikvisioncam.switch
hikvision==0.4 hikvision==0.4
# homeassistant.components.notify.hipchat # homeassistant.components.hipchat.notify
hipnotify==1.0.8 hipnotify==1.0.8
# homeassistant.components.harman_kardon_avr.media_player # homeassistant.components.harman_kardon_avr.media_player
@ -602,7 +602,7 @@ ipify==1.0.0
jsonpath==0.75 jsonpath==0.75
# homeassistant.components.kodi.media_player # homeassistant.components.kodi.media_player
# homeassistant.components.notify.kodi # homeassistant.components.kodi.notify
jsonrpc-async==0.6 jsonrpc-async==0.6
# homeassistant.components.kodi.media_player # homeassistant.components.kodi.media_player
@ -690,7 +690,7 @@ maxcube-api==0.1.0
# homeassistant.components.mythicbeastsdns # homeassistant.components.mythicbeastsdns
mbddns==0.1.2 mbddns==0.1.2
# homeassistant.components.notify.message_bird # homeassistant.components.message_bird.notify
messagebird==1.2.0 messagebird==1.2.0
# homeassistant.components.meteo_france # homeassistant.components.meteo_france
@ -876,11 +876,11 @@ psutil==5.6.1
# homeassistant.components.wink # homeassistant.components.wink
pubnubsub-handler==1.0.3 pubnubsub-handler==1.0.3
# homeassistant.components.notify.pushbullet # homeassistant.components.pushbullet.notify
# homeassistant.components.pushbullet.sensor # homeassistant.components.pushbullet.sensor
pushbullet.py==0.11.0 pushbullet.py==0.11.0
# homeassistant.components.notify.pushetta # homeassistant.components.pushetta.notify
pushetta==1.0.15 pushetta==1.0.15
# homeassistant.components.rpi_gpio_pwm.light # homeassistant.components.rpi_gpio_pwm.light
@ -1283,7 +1283,7 @@ pysonos==0.0.8
# homeassistant.components.spc # homeassistant.components.spc
pyspcwebgw==0.4.0 pyspcwebgw==0.4.0
# homeassistant.components.notify.stride # homeassistant.components.stride.notify
pystride==0.1.7 pystride==0.1.7
# homeassistant.components.syncthru.sensor # homeassistant.components.syncthru.sensor
@ -1338,7 +1338,7 @@ python-hpilo==3.9
# homeassistant.components.joaoapps_join # homeassistant.components.joaoapps_join
# homeassistant.components.joaoapps_join.notify # homeassistant.components.joaoapps_join.notify
python-join-api==0.0.2 python-join-api==0.0.4
# homeassistant.components.juicenet # homeassistant.components.juicenet
python-juicenet==0.0.5 python-juicenet==0.0.5
@ -1368,7 +1368,7 @@ python-nest==4.1.0
# homeassistant.components.nmap_tracker.device_tracker # homeassistant.components.nmap_tracker.device_tracker
python-nmap==0.6.1 python-nmap==0.6.1
# homeassistant.components.notify.pushover # homeassistant.components.pushover.notify
python-pushover==0.3 python-pushover==0.3
# homeassistant.components.qbittorrent.sensor # homeassistant.components.qbittorrent.sensor
@ -1461,7 +1461,7 @@ pyvizio==0.0.4
# homeassistant.components.velux # homeassistant.components.velux
pyvlx==0.2.10 pyvlx==0.2.10
# homeassistant.components.notify.html5 # homeassistant.components.html5.notify
pywebpush==1.6.0 pywebpush==1.6.0
# homeassistant.components.wemo # homeassistant.components.wemo
@ -1521,7 +1521,7 @@ ritassist==0.9.2
# homeassistant.components.rejseplanen.sensor # homeassistant.components.rejseplanen.sensor
rjpl==0.3.5 rjpl==0.3.5
# homeassistant.components.notify.rocketchat # homeassistant.components.rocketchat.notify
rocketchat-API==0.6.1 rocketchat-API==0.6.1
# homeassistant.components.roomba.vacuum # homeassistant.components.roomba.vacuum
@ -1554,7 +1554,7 @@ schiene==0.23
# homeassistant.components.scsgate # homeassistant.components.scsgate
scsgate==0.1.0 scsgate==0.1.0
# homeassistant.components.notify.sendgrid # homeassistant.components.sendgrid.notify
sendgrid==5.6.0 sendgrid==5.6.0
# homeassistant.components.sensehat.light # homeassistant.components.sensehat.light
@ -1570,7 +1570,7 @@ sharp_aquos_rc==0.3.2
# homeassistant.components.shodan.sensor # homeassistant.components.shodan.sensor
shodan==1.11.1 shodan==1.11.1
# homeassistant.components.notify.simplepush # homeassistant.components.simplepush.notify
simplepush==1.1.4 simplepush==1.1.4
# homeassistant.components.simplisafe # homeassistant.components.simplisafe
@ -1582,13 +1582,13 @@ sisyphus-control==2.1
# homeassistant.components.skybell # homeassistant.components.skybell
skybellpy==0.3.0 skybellpy==0.3.0
# homeassistant.components.notify.slack # homeassistant.components.slack.notify
slacker==0.12.0 slacker==0.12.0
# homeassistant.components.sleepiq # homeassistant.components.sleepiq
sleepyq==0.6 sleepyq==0.6
# homeassistant.components.notify.xmpp # homeassistant.components.xmpp.notify
slixmpp==1.4.2 slixmpp==1.4.2
# homeassistant.components.smappee # homeassistant.components.smappee

View file

@ -31,7 +31,7 @@ PyRMVtransport==0.1.3
# homeassistant.components.transport_nsw.sensor # homeassistant.components.transport_nsw.sensor
PyTransportNSW==0.1.1 PyTransportNSW==0.1.1
# homeassistant.components.notify.yessssms # homeassistant.components.yessssms.notify
YesssSMS==0.2.3 YesssSMS==0.2.3
# homeassistant.components.ambient_station # homeassistant.components.ambient_station
@ -53,7 +53,7 @@ aiohue==1.9.1
# homeassistant.components.unifi # homeassistant.components.unifi
aiounifi==4 aiounifi==4
# homeassistant.components.notify.apns # homeassistant.components.apns.notify
apns2==0.3.0 apns2==0.3.0
# homeassistant.components.stream # homeassistant.components.stream
@ -186,7 +186,7 @@ pmsensor==0.4
# homeassistant.components.prometheus # homeassistant.components.prometheus
prometheus_client==0.2.0 prometheus_client==0.2.0
# homeassistant.components.notify.pushbullet # homeassistant.components.pushbullet.notify
# homeassistant.components.pushbullet.sensor # homeassistant.components.pushbullet.sensor
pushbullet.py==0.11.0 pushbullet.py==0.11.0
@ -260,7 +260,7 @@ pytradfri[async]==6.0.1
# homeassistant.components.unifi.device_tracker # homeassistant.components.unifi.device_tracker
pyunifi==2.16 pyunifi==2.16
# homeassistant.components.notify.html5 # homeassistant.components.html5.notify
pywebpush==1.6.0 pywebpush==1.6.0
# homeassistant.components.rainmachine # homeassistant.components.rainmachine

View file

@ -0,0 +1 @@
"""Tests for the apns component."""

View file

@ -8,7 +8,7 @@ import yaml
import homeassistant.components.notify as notify import homeassistant.components.notify as notify
from homeassistant.setup import setup_component from homeassistant.setup import setup_component
from homeassistant.components.notify import apns import homeassistant.components.apns.notify as apns
from homeassistant.core import State from homeassistant.core import State
from tests.common import assert_setup_component, get_test_home_assistant from tests.common import assert_setup_component, get_test_home_assistant
@ -23,7 +23,7 @@ CONFIG = {
} }
@patch('homeassistant.components.notify.apns.open', mock_open(), create=True) @patch('homeassistant.components.apns.notify.open', mock_open(), create=True)
class TestApns(unittest.TestCase): class TestApns(unittest.TestCase):
"""Test the APNS component.""" """Test the APNS component."""
@ -102,7 +102,7 @@ class TestApns(unittest.TestCase):
assert setup_component(self.hass, notify.DOMAIN, config) assert setup_component(self.hass, notify.DOMAIN, config)
assert not handle_config[notify.DOMAIN] assert not handle_config[notify.DOMAIN]
@patch('homeassistant.components.notify.apns._write_device') @patch('homeassistant.components.apns.notify._write_device')
def test_register_new_device(self, mock_write): def test_register_new_device(self, mock_write):
"""Test registering a new device with a name.""" """Test registering a new device with a name."""
yaml_file = {5678: {'name': 'test device 2'}} yaml_file = {5678: {'name': 'test device 2'}}
@ -116,7 +116,7 @@ class TestApns(unittest.TestCase):
mock_write.side_effect = fake_write mock_write.side_effect = fake_write
with patch( with patch(
'homeassistant.components.notify.apns.load_yaml_config_file', 'homeassistant.components.apns.notify.load_yaml_config_file',
Mock(return_value=yaml_file)): Mock(return_value=yaml_file)):
self._setup_notify() self._setup_notify()
@ -128,7 +128,7 @@ class TestApns(unittest.TestCase):
assert len(written_devices) == 1 assert len(written_devices) == 1
assert written_devices[0].name == 'test device' assert written_devices[0].name == 'test device'
@patch('homeassistant.components.notify.apns._write_device') @patch('homeassistant.components.apns.notify._write_device')
def test_register_device_without_name(self, mock_write): def test_register_device_without_name(self, mock_write):
"""Test registering a without a name.""" """Test registering a without a name."""
yaml_file = { yaml_file = {
@ -151,7 +151,7 @@ class TestApns(unittest.TestCase):
mock_write.side_effect = fake_write mock_write.side_effect = fake_write
with patch( with patch(
'homeassistant.components.notify.apns.load_yaml_config_file', 'homeassistant.components.apns.notify.load_yaml_config_file',
Mock(return_value=yaml_file)): Mock(return_value=yaml_file)):
self._setup_notify() self._setup_notify()
@ -166,7 +166,7 @@ class TestApns(unittest.TestCase):
assert test_device is not None assert test_device is not None
assert test_device.name is None assert test_device.name is None
@patch('homeassistant.components.notify.apns._write_device') @patch('homeassistant.components.apns.notify._write_device')
def test_update_existing_device(self, mock_write): def test_update_existing_device(self, mock_write):
"""Test updating an existing device.""" """Test updating an existing device."""
yaml_file = { yaml_file = {
@ -187,7 +187,7 @@ class TestApns(unittest.TestCase):
mock_write.side_effect = fake_write mock_write.side_effect = fake_write
with patch( with patch(
'homeassistant.components.notify.apns.load_yaml_config_file', 'homeassistant.components.apns.notify.load_yaml_config_file',
Mock(return_value=yaml_file)): Mock(return_value=yaml_file)):
self._setup_notify() self._setup_notify()
@ -206,7 +206,7 @@ class TestApns(unittest.TestCase):
assert 'updated device 1' == test_device_1.name assert 'updated device 1' == test_device_1.name
@patch('homeassistant.components.notify.apns._write_device') @patch('homeassistant.components.apns.notify._write_device')
def test_update_existing_device_with_tracking_id(self, mock_write): def test_update_existing_device_with_tracking_id(self, mock_write):
"""Test updating an existing device that has a tracking id.""" """Test updating an existing device that has a tracking id."""
yaml_file = { yaml_file = {
@ -229,7 +229,7 @@ class TestApns(unittest.TestCase):
mock_write.side_effect = fake_write mock_write.side_effect = fake_write
with patch( with patch(
'homeassistant.components.notify.apns.load_yaml_config_file', 'homeassistant.components.apns.notify.load_yaml_config_file',
Mock(return_value=yaml_file)): Mock(return_value=yaml_file)):
self._setup_notify() self._setup_notify()
@ -259,7 +259,7 @@ class TestApns(unittest.TestCase):
yaml_file = {1234: {'name': 'test device 1'}} yaml_file = {1234: {'name': 'test device 1'}}
with patch( with patch(
'homeassistant.components.notify.apns.load_yaml_config_file', 'homeassistant.components.apns.notify.load_yaml_config_file',
Mock(return_value=yaml_file)): Mock(return_value=yaml_file)):
self._setup_notify() self._setup_notify()
@ -294,7 +294,7 @@ class TestApns(unittest.TestCase):
}} }}
with patch( with patch(
'homeassistant.components.notify.apns.load_yaml_config_file', 'homeassistant.components.apns.notify.load_yaml_config_file',
Mock(return_value=yaml_file)): Mock(return_value=yaml_file)):
self._setup_notify() self._setup_notify()
@ -325,7 +325,7 @@ class TestApns(unittest.TestCase):
} }
with patch( with patch(
'homeassistant.components.notify.apns.load_yaml_config_file', 'homeassistant.components.apns.notify.load_yaml_config_file',
Mock(return_value=yaml_file)), \ Mock(return_value=yaml_file)), \
patch('os.path.isfile', Mock(return_value=True)): patch('os.path.isfile', Mock(return_value=True)):
notify_service = apns.ApnsNotificationService( notify_service = apns.ApnsNotificationService(
@ -353,7 +353,7 @@ class TestApns(unittest.TestCase):
assert 'Hello' == payload.alert assert 'Hello' == payload.alert
@patch('apns2.client.APNsClient') @patch('apns2.client.APNsClient')
@patch('homeassistant.components.notify.apns._write_device') @patch('homeassistant.components.apns.notify._write_device')
def test_disable_when_unregistered(self, mock_write, mock_client): def test_disable_when_unregistered(self, mock_write, mock_client):
"""Test disabling a device when it is unregistered.""" """Test disabling a device when it is unregistered."""
send = mock_client.return_value.send_notification send = mock_client.return_value.send_notification
@ -379,7 +379,7 @@ class TestApns(unittest.TestCase):
mock_write.side_effect = fake_write mock_write.side_effect = fake_write
with patch( with patch(
'homeassistant.components.notify.apns.load_yaml_config_file', 'homeassistant.components.apns.notify.load_yaml_config_file',
Mock(return_value=yaml_file)): Mock(return_value=yaml_file)):
self._setup_notify() self._setup_notify()

View file

@ -65,7 +65,7 @@ class TestCommandLine(unittest.TestCase):
# the echo command adds a line break # the echo command adds a line break
assert fil.read() == "{}\n".format(message) assert fil.read() == "{}\n".format(message)
@patch('homeassistant.components.notify.command_line._LOGGER.error') @patch('homeassistant.components.command_line.notify._LOGGER.error')
def test_error_for_none_zero_exit_code(self, mock_error): def test_error_for_none_zero_exit_code(self, mock_error):
"""Test if an error is logged for non zero exit codes.""" """Test if an error is logged for non zero exit codes."""
with assert_setup_component(1) as handle_config: with assert_setup_component(1) as handle_config:

View file

@ -7,7 +7,7 @@ import voluptuous as vol
import homeassistant.components.notify as notify import homeassistant.components.notify as notify
from homeassistant.setup import setup_component from homeassistant.setup import setup_component
from homeassistant.components.notify import demo import homeassistant.components.demo.notify as demo
from homeassistant.core import callback from homeassistant.core import callback
from homeassistant.helpers import discovery, script from homeassistant.helpers import discovery, script
@ -50,7 +50,7 @@ class TestNotifyDemo(unittest.TestCase):
"""Test setup.""" """Test setup."""
self._setup_notify() self._setup_notify()
@patch('homeassistant.components.notify.demo.get_service', autospec=True) @patch('homeassistant.components.demo.notify.get_service', autospec=True)
def test_no_notify_service(self, mock_demo_get_service): def test_no_notify_service(self, mock_demo_get_service):
"""Test missing platform notify service instance.""" """Test missing platform notify service instance."""
mock_demo_get_service.return_value = None mock_demo_get_service.return_value = None
@ -63,7 +63,7 @@ class TestNotifyDemo(unittest.TestCase):
['ERROR:homeassistant.components.notify:' ['ERROR:homeassistant.components.notify:'
'Failed to initialize notification service demo'] 'Failed to initialize notification service demo']
@patch('homeassistant.components.notify.demo.get_service', autospec=True) @patch('homeassistant.components.demo.notify.get_service', autospec=True)
def test_discover_notify(self, mock_demo_get_service): def test_discover_notify(self, mock_demo_get_service):
"""Test discovery of notify demo platform.""" """Test discovery of notify demo platform."""
assert notify.DOMAIN not in self.hass.config.components assert notify.DOMAIN not in self.hass.config.components

View file

@ -0,0 +1 @@
"""Tests for the facebook component."""

View file

@ -2,7 +2,8 @@
import unittest import unittest
import requests_mock import requests_mock
import homeassistant.components.notify.facebook as facebook # import homeassistant.components.facebook as facebook
import homeassistant.components.facebook.notify as facebook
class TestFacebook(unittest.TestCase): class TestFacebook(unittest.TestCase):

View file

@ -52,9 +52,9 @@ class TestNotifyFile(unittest.TestCase):
m_open = mock_open() m_open = mock_open()
with patch( with patch(
'homeassistant.components.notify.file.open', 'homeassistant.components.file.notify.open',
m_open, create=True m_open, create=True
), patch('homeassistant.components.notify.file.os.stat') as mock_st, \ ), patch('homeassistant.components.file.notify.os.stat') as mock_st, \
patch('homeassistant.util.dt.utcnow', patch('homeassistant.util.dt.utcnow',
return_value=dt_util.utcnow()): return_value=dt_util.utcnow()):

View file

@ -4,7 +4,8 @@ from unittest.mock import MagicMock, patch
from homeassistant.setup import setup_component from homeassistant.setup import setup_component
import homeassistant.components.notify as notify import homeassistant.components.notify as notify
from homeassistant.components.notify import group, demo import homeassistant.components.group.notify as group
import homeassistant.components.demo.notify as demo
from homeassistant.util.async_ import run_coroutine_threadsafe from homeassistant.util.async_ import run_coroutine_threadsafe
from tests.common import assert_setup_component, get_test_home_assistant from tests.common import assert_setup_component, get_test_home_assistant

View file

@ -0,0 +1 @@
"""Tests for the homematic component."""

View file

@ -0,0 +1 @@
"""Tests for the html5 component."""

View file

@ -5,7 +5,7 @@ from aiohttp.hdrs import AUTHORIZATION
from homeassistant.setup import async_setup_component from homeassistant.setup import async_setup_component
from homeassistant.exceptions import HomeAssistantError from homeassistant.exceptions import HomeAssistantError
from homeassistant.components.notify import html5 import homeassistant.components.html5.notify as html5
CONFIG_FILE = 'file.conf' CONFIG_FILE = 'file.conf'
@ -54,7 +54,7 @@ async def mock_client(hass, hass_client, registrations=None):
if registrations is None: if registrations is None:
registrations = {} registrations = {}
with patch('homeassistant.components.notify.html5._load_config', with patch('homeassistant.components.html5.notify._load_config',
return_value=registrations): return_value=registrations):
await async_setup_component(hass, 'notify', { await async_setup_component(hass, 'notify', {
'notify': { 'notify': {
@ -189,7 +189,7 @@ async def test_registering_new_device_view(hass, hass_client):
"""Test that the HTML view works.""" """Test that the HTML view works."""
client = await mock_client(hass, hass_client) client = await mock_client(hass, hass_client)
with patch('homeassistant.components.notify.html5.save_json') as mock_save: with patch('homeassistant.components.html5.notify.save_json') as mock_save:
resp = await client.post(REGISTER_URL, data=json.dumps(SUBSCRIPTION_1)) resp = await client.post(REGISTER_URL, data=json.dumps(SUBSCRIPTION_1))
assert resp.status == 200 assert resp.status == 200
@ -206,7 +206,7 @@ async def test_registering_new_device_view_with_name(hass, hass_client):
SUB_WITH_NAME = SUBSCRIPTION_1.copy() SUB_WITH_NAME = SUBSCRIPTION_1.copy()
SUB_WITH_NAME['name'] = 'test device' SUB_WITH_NAME['name'] = 'test device'
with patch('homeassistant.components.notify.html5.save_json') as mock_save: with patch('homeassistant.components.html5.notify.save_json') as mock_save:
resp = await client.post(REGISTER_URL, data=json.dumps(SUB_WITH_NAME)) resp = await client.post(REGISTER_URL, data=json.dumps(SUB_WITH_NAME))
assert resp.status == 200 assert resp.status == 200
@ -220,7 +220,7 @@ async def test_registering_new_device_expiration_view(hass, hass_client):
"""Test that the HTML view works.""" """Test that the HTML view works."""
client = await mock_client(hass, hass_client) client = await mock_client(hass, hass_client)
with patch('homeassistant.components.notify.html5.save_json') as mock_save: with patch('homeassistant.components.html5.notify.save_json') as mock_save:
resp = await client.post(REGISTER_URL, data=json.dumps(SUBSCRIPTION_4)) resp = await client.post(REGISTER_URL, data=json.dumps(SUBSCRIPTION_4))
assert resp.status == 200 assert resp.status == 200
@ -234,7 +234,7 @@ async def test_registering_new_device_fails_view(hass, hass_client):
registrations = {} registrations = {}
client = await mock_client(hass, hass_client, registrations) client = await mock_client(hass, hass_client, registrations)
with patch('homeassistant.components.notify.html5.save_json', with patch('homeassistant.components.html5.notify.save_json',
side_effect=HomeAssistantError()): side_effect=HomeAssistantError()):
resp = await client.post(REGISTER_URL, data=json.dumps(SUBSCRIPTION_4)) resp = await client.post(REGISTER_URL, data=json.dumps(SUBSCRIPTION_4))
@ -247,7 +247,7 @@ async def test_registering_existing_device_view(hass, hass_client):
registrations = {} registrations = {}
client = await mock_client(hass, hass_client, registrations) client = await mock_client(hass, hass_client, registrations)
with patch('homeassistant.components.notify.html5.save_json') as mock_save: with patch('homeassistant.components.html5.notify.save_json') as mock_save:
await client.post(REGISTER_URL, data=json.dumps(SUBSCRIPTION_1)) await client.post(REGISTER_URL, data=json.dumps(SUBSCRIPTION_1))
resp = await client.post(REGISTER_URL, data=json.dumps(SUBSCRIPTION_4)) resp = await client.post(REGISTER_URL, data=json.dumps(SUBSCRIPTION_4))
@ -268,7 +268,7 @@ async def test_registering_existing_device_view_with_name(hass, hass_client):
SUB_WITH_NAME = SUBSCRIPTION_1.copy() SUB_WITH_NAME = SUBSCRIPTION_1.copy()
SUB_WITH_NAME['name'] = 'test device' SUB_WITH_NAME['name'] = 'test device'
with patch('homeassistant.components.notify.html5.save_json') as mock_save: with patch('homeassistant.components.html5.notify.save_json') as mock_save:
await client.post(REGISTER_URL, data=json.dumps(SUB_WITH_NAME)) await client.post(REGISTER_URL, data=json.dumps(SUB_WITH_NAME))
resp = await client.post(REGISTER_URL, data=json.dumps(SUBSCRIPTION_4)) resp = await client.post(REGISTER_URL, data=json.dumps(SUBSCRIPTION_4))
@ -286,7 +286,7 @@ async def test_registering_existing_device_fails_view(hass, hass_client):
registrations = {} registrations = {}
client = await mock_client(hass, hass_client, registrations) client = await mock_client(hass, hass_client, registrations)
with patch('homeassistant.components.notify.html5.save_json') as mock_save: with patch('homeassistant.components.html5.notify.save_json') as mock_save:
await client.post(REGISTER_URL, data=json.dumps(SUBSCRIPTION_1)) await client.post(REGISTER_URL, data=json.dumps(SUBSCRIPTION_1))
mock_save.side_effect = HomeAssistantError mock_save.side_effect = HomeAssistantError
resp = await client.post(REGISTER_URL, data=json.dumps(SUBSCRIPTION_4)) resp = await client.post(REGISTER_URL, data=json.dumps(SUBSCRIPTION_4))
@ -312,7 +312,7 @@ async def test_registering_new_device_validation(hass, hass_client):
})) }))
assert resp.status == 400 assert resp.status == 400
with patch('homeassistant.components.notify.html5.save_json', with patch('homeassistant.components.html5.notify.save_json',
return_value=False): return_value=False):
resp = await client.post(REGISTER_URL, data=json.dumps({ resp = await client.post(REGISTER_URL, data=json.dumps({
'browser': 'chrome', 'browser': 'chrome',
@ -329,7 +329,7 @@ async def test_unregistering_device_view(hass, hass_client):
} }
client = await mock_client(hass, hass_client, registrations) client = await mock_client(hass, hass_client, registrations)
with patch('homeassistant.components.notify.html5.save_json') as mock_save: with patch('homeassistant.components.html5.notify.save_json') as mock_save:
resp = await client.delete(REGISTER_URL, data=json.dumps({ resp = await client.delete(REGISTER_URL, data=json.dumps({
'subscription': SUBSCRIPTION_1['subscription'], 'subscription': SUBSCRIPTION_1['subscription'],
})) }))
@ -347,7 +347,7 @@ async def test_unregister_device_view_handle_unknown_subscription(
registrations = {} registrations = {}
client = await mock_client(hass, hass_client, registrations) client = await mock_client(hass, hass_client, registrations)
with patch('homeassistant.components.notify.html5.save_json') as mock_save: with patch('homeassistant.components.html5.notify.save_json') as mock_save:
resp = await client.delete(REGISTER_URL, data=json.dumps({ resp = await client.delete(REGISTER_URL, data=json.dumps({
'subscription': SUBSCRIPTION_3['subscription'] 'subscription': SUBSCRIPTION_3['subscription']
})) }))
@ -366,7 +366,7 @@ async def test_unregistering_device_view_handles_save_error(
} }
client = await mock_client(hass, hass_client, registrations) client = await mock_client(hass, hass_client, registrations)
with patch('homeassistant.components.notify.html5.save_json', with patch('homeassistant.components.html5.notify.save_json',
side_effect=HomeAssistantError()): side_effect=HomeAssistantError()):
resp = await client.delete(REGISTER_URL, data=json.dumps({ resp = await client.delete(REGISTER_URL, data=json.dumps({
'subscription': SUBSCRIPTION_1['subscription'], 'subscription': SUBSCRIPTION_1['subscription'],

View file

@ -0,0 +1 @@
"""Tests for the pushbullet component."""

Some files were not shown because too many files have changed in this diff Show more