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:
parent
92457ca5ca
commit
7741ec4d5a
105 changed files with 653 additions and 582 deletions
915
.coveragerc
915
.coveragerc
File diff suppressed because it is too large
Load diff
1
homeassistant/components/apns/__init__.py
Normal file
1
homeassistant/components/apns/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The apns component."""
|
|
@ -15,7 +15,7 @@ from homeassistant.helpers import template as template_helper
|
|||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.event import track_state_change
|
||||
|
||||
from . import (
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA, ATTR_TARGET, DOMAIN, PLATFORM_SCHEMA, BaseNotificationService)
|
||||
|
||||
REQUIREMENTS = ['apns2==0.3.0']
|
1
homeassistant/components/aws_lambda/__init__.py
Normal file
1
homeassistant/components/aws_lambda/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The aws_lambda component."""
|
|
@ -14,7 +14,8 @@ from homeassistant.const import CONF_NAME, CONF_PLATFORM
|
|||
import homeassistant.helpers.config_validation as cv
|
||||
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']
|
||||
|
1
homeassistant/components/aws_sns/__init__.py
Normal file
1
homeassistant/components/aws_sns/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The aws_sns component."""
|
|
@ -12,7 +12,7 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_NAME, CONF_PLATFORM
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import (
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA,
|
||||
BaseNotificationService)
|
||||
|
1
homeassistant/components/aws_sqs/__init__.py
Normal file
1
homeassistant/components/aws_sqs/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The aws_sqs component."""
|
|
@ -12,7 +12,8 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_NAME, CONF_PLATFORM
|
||||
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__)
|
||||
REQUIREMENTS = ["boto3==1.9.16"]
|
1
homeassistant/components/ciscospark/__init__.py
Normal file
1
homeassistant/components/ciscospark/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The ciscospark component."""
|
|
@ -11,7 +11,8 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_TOKEN
|
||||
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']
|
||||
|
1
homeassistant/components/clickatell/__init__.py
Normal file
1
homeassistant/components/clickatell/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The clickatell component."""
|
|
@ -12,7 +12,8 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_API_KEY, CONF_RECIPIENT
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import PLATFORM_SCHEMA, BaseNotificationService
|
||||
from homeassistant.components.notify import (PLATFORM_SCHEMA,
|
||||
BaseNotificationService)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
1
homeassistant/components/clicksend/__init__.py
Normal file
1
homeassistant/components/clicksend/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The clicksend component."""
|
|
@ -16,7 +16,8 @@ from homeassistant.const import (
|
|||
CONTENT_TYPE_JSON)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import PLATFORM_SCHEMA, BaseNotificationService
|
||||
from homeassistant.components.notify import (PLATFORM_SCHEMA,
|
||||
BaseNotificationService)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
1
homeassistant/components/clicksend_tts/__init__.py
Normal file
1
homeassistant/components/clicksend_tts/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The clicksend_tts component."""
|
|
@ -17,7 +17,8 @@ from homeassistant.const import (
|
|||
CONF_API_KEY, CONF_RECIPIENT, CONF_USERNAME, CONTENT_TYPE_JSON)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import PLATFORM_SCHEMA, BaseNotificationService
|
||||
from homeassistant.components.notify import (PLATFORM_SCHEMA,
|
||||
BaseNotificationService)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
|
@ -12,7 +12,8 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_COMMAND, CONF_NAME
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import PLATFORM_SCHEMA, BaseNotificationService
|
||||
from homeassistant.components.notify import (PLATFORM_SCHEMA,
|
||||
BaseNotificationService)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
|
@ -4,7 +4,7 @@ Demo notification service.
|
|||
For more details about this platform, please refer to the documentation
|
||||
https://home-assistant.io/components/demo/
|
||||
"""
|
||||
from . import BaseNotificationService
|
||||
from homeassistant.components.notify import BaseNotificationService
|
||||
|
||||
EVENT_NOTIFY = "notify"
|
||||
|
1
homeassistant/components/discord/__init__.py
Normal file
1
homeassistant/components/discord/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The discord component."""
|
|
@ -11,7 +11,9 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_TOKEN
|
||||
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__)
|
||||
|
1
homeassistant/components/facebook/__init__.py
Normal file
1
homeassistant/components/facebook/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The facebook component."""
|
|
@ -14,7 +14,9 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONTENT_TYPE_JSON
|
||||
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__)
|
||||
|
|
@ -13,7 +13,7 @@ from homeassistant.const import CONF_FILENAME
|
|||
import homeassistant.helpers.config_validation as cv
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
from . import (
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService)
|
||||
|
||||
CONF_TIMESTAMP = 'timestamp'
|
1
homeassistant/components/flock/__init__.py
Normal file
1
homeassistant/components/flock/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The flock component."""
|
|
@ -14,7 +14,8 @@ from homeassistant.const import CONF_ACCESS_TOKEN
|
|||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import PLATFORM_SCHEMA, BaseNotificationService
|
||||
from homeassistant.components.notify import (PLATFORM_SCHEMA,
|
||||
BaseNotificationService)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
_RESOURCE = 'https://api.flock.com/hooks/sendMessage/'
|
1
homeassistant/components/free_mobile/__init__.py
Normal file
1
homeassistant/components/free_mobile/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The free_mobile component."""
|
|
@ -11,7 +11,8 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_USERNAME
|
||||
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']
|
||||
|
1
homeassistant/components/gntp/__init__.py
Normal file
1
homeassistant/components/gntp/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The gntp component."""
|
|
@ -12,7 +12,7 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_PASSWORD, CONF_PORT
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import (
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService)
|
||||
|
||||
REQUIREMENTS = ['gntp==1.0.3']
|
|
@ -14,7 +14,7 @@ import voluptuous as vol
|
|||
from homeassistant.const import ATTR_SERVICE
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import (
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA, ATTR_MESSAGE, DOMAIN, PLATFORM_SCHEMA, BaseNotificationService)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
1
homeassistant/components/hipchat/__init__.py
Normal file
1
homeassistant/components/hipchat/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The hipchat component."""
|
|
@ -11,7 +11,9 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_HOST, CONF_ROOM, CONF_TOKEN
|
||||
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']
|
||||
|
1
homeassistant/components/html5/__init__.py
Normal file
1
homeassistant/components/html5/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The html5 component."""
|
|
@ -25,7 +25,7 @@ from homeassistant.helpers import config_validation as cv
|
|||
from homeassistant.util import ensure_unique_string
|
||||
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,
|
||||
PLATFORM_SCHEMA, BaseNotificationService)
|
||||
|
|
@ -15,7 +15,7 @@ from homeassistant.const import (
|
|||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import (
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA,
|
||||
BaseNotificationService)
|
||||
|
1
homeassistant/components/lannouncer/__init__.py
Normal file
1
homeassistant/components/lannouncer/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The lannouncer component."""
|
|
@ -13,7 +13,8 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_HOST, CONF_PORT
|
||||
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_DEFAULT = 'speak'
|
1
homeassistant/components/llamalab_automate/__init__.py
Normal file
1
homeassistant/components/llamalab_automate/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The llamalab_automate component."""
|
|
@ -12,7 +12,8 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_API_KEY, CONF_DEVICE
|
||||
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__)
|
||||
_RESOURCE = 'https://llamalab.com/automate/cloud/message'
|
1
homeassistant/components/mastodon/__init__.py
Normal file
1
homeassistant/components/mastodon/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The mastodon component."""
|
|
@ -11,7 +11,8 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_ACCESS_TOKEN
|
||||
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']
|
||||
|
1
homeassistant/components/message_bird/__init__.py
Normal file
1
homeassistant/components/message_bird/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The message_bird component."""
|
|
@ -11,7 +11,8 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_API_KEY, CONF_SENDER
|
||||
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']
|
||||
|
|
@ -6,7 +6,7 @@ https://home-assistant.io/components/notify.mycroft/
|
|||
"""
|
||||
import logging
|
||||
|
||||
from . import BaseNotificationService
|
||||
from homeassistant.components.notify import BaseNotificationService
|
||||
|
||||
DEPENDENCIES = ['mycroft']
|
||||
|
1
homeassistant/components/nfandroidtv/__init__.py
Normal file
1
homeassistant/components/nfandroidtv/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The nfandroidtv component."""
|
|
@ -15,7 +15,7 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_TIMEOUT, CONF_HOST
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import (
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA,
|
||||
BaseNotificationService)
|
||||
|
1
homeassistant/components/prowl/__init__.py
Normal file
1
homeassistant/components/prowl/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The prowl component."""
|
|
@ -14,7 +14,7 @@ from homeassistant.const import CONF_API_KEY
|
|||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import (
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA,
|
||||
BaseNotificationService)
|
||||
|
|
@ -12,7 +12,7 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_API_KEY
|
||||
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,
|
||||
BaseNotificationService)
|
||||
|
1
homeassistant/components/pushetta/__init__.py
Normal file
1
homeassistant/components/pushetta/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The pushetta component."""
|
|
@ -11,7 +11,7 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_API_KEY
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import (
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
1
homeassistant/components/pushover/__init__.py
Normal file
1
homeassistant/components/pushover/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The pushover component."""
|
|
@ -11,7 +11,7 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_API_KEY
|
||||
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,
|
||||
BaseNotificationService)
|
||||
|
1
homeassistant/components/pushsafer/__init__.py
Normal file
1
homeassistant/components/pushsafer/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The pushsafer component."""
|
|
@ -14,7 +14,7 @@ import voluptuous as vol
|
|||
|
||||
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,
|
||||
BaseNotificationService)
|
||||
|
|
@ -15,7 +15,7 @@ from homeassistant.const import (
|
|||
HTTP_DIGEST_AUTHENTICATION)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import (
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA,
|
||||
BaseNotificationService)
|
||||
|
1
homeassistant/components/rocketchat/__init__.py
Normal file
1
homeassistant/components/rocketchat/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The rocketchat component."""
|
|
@ -12,7 +12,8 @@ from homeassistant.const import (
|
|||
CONF_PASSWORD, CONF_ROOM, CONF_URL, CONF_USERNAME)
|
||||
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']
|
||||
|
1
homeassistant/components/sendgrid/__init__.py
Normal file
1
homeassistant/components/sendgrid/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The sendgrid component."""
|
|
@ -12,7 +12,7 @@ from homeassistant.const import (
|
|||
CONF_API_KEY, CONF_RECIPIENT, CONF_SENDER, CONTENT_TYPE_TEXT_PLAIN)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import (
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService)
|
||||
|
||||
REQUIREMENTS = ['sendgrid==5.6.0']
|
1
homeassistant/components/simplepush/__init__.py
Normal file
1
homeassistant/components/simplepush/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The simplepush component."""
|
|
@ -11,7 +11,7 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_PASSWORD
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import (
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService)
|
||||
|
||||
REQUIREMENTS = ['simplepush==1.1.4']
|
1
homeassistant/components/slack/__init__.py
Normal file
1
homeassistant/components/slack/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The slack component."""
|
|
@ -13,7 +13,7 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_API_KEY, CONF_ICON, CONF_USERNAME
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import (
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA, ATTR_TARGET, ATTR_TITLE, PLATFORM_SCHEMA,
|
||||
BaseNotificationService)
|
||||
|
1
homeassistant/components/smtp/__init__.py
Normal file
1
homeassistant/components/smtp/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The smtp component."""
|
|
@ -21,7 +21,7 @@ from homeassistant.const import (
|
|||
import homeassistant.helpers.config_validation as cv
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
from . import (
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA,
|
||||
BaseNotificationService)
|
||||
|
1
homeassistant/components/stride/__init__.py
Normal file
1
homeassistant/components/stride/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The stride component."""
|
|
@ -11,7 +11,9 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_ROOM, CONF_TOKEN
|
||||
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']
|
||||
|
1
homeassistant/components/synology_chat/__init__.py
Normal file
1
homeassistant/components/synology_chat/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The synology_chat component."""
|
|
@ -13,7 +13,8 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_RESOURCE, CONF_VERIFY_SSL
|
||||
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'
|
||||
|
1
homeassistant/components/syslog/__init__.py
Normal file
1
homeassistant/components/syslog/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The syslog component."""
|
|
@ -8,7 +8,7 @@ import logging
|
|||
|
||||
import voluptuous as vol
|
||||
|
||||
from . import (
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
1
homeassistant/components/telegram/__init__.py
Normal file
1
homeassistant/components/telegram/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The telegram component."""
|
|
@ -10,7 +10,7 @@ import voluptuous as vol
|
|||
|
||||
from homeassistant.const import ATTR_LOCATION
|
||||
|
||||
from . import (
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA, ATTR_MESSAGE, ATTR_TARGET, ATTR_TITLE, PLATFORM_SCHEMA,
|
||||
BaseNotificationService)
|
||||
|
1
homeassistant/components/twilio_call/__init__.py
Normal file
1
homeassistant/components/twilio_call/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The twilio_call component."""
|
|
@ -12,7 +12,8 @@ import voluptuous as vol
|
|||
from homeassistant.components.twilio import DATA_TWILIO
|
||||
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__)
|
||||
|
1
homeassistant/components/twilio_sms/__init__.py
Normal file
1
homeassistant/components/twilio_sms/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The twilio_sms component."""
|
|
@ -11,7 +11,8 @@ import voluptuous as vol
|
|||
from homeassistant.components.twilio import DATA_TWILIO
|
||||
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__)
|
||||
DEPENDENCIES = ["twilio"]
|
1
homeassistant/components/twitter/__init__.py
Normal file
1
homeassistant/components/twitter/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The twitter component."""
|
|
@ -17,7 +17,8 @@ from homeassistant.const import CONF_ACCESS_TOKEN, CONF_USERNAME
|
|||
import homeassistant.helpers.config_validation as cv
|
||||
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']
|
||||
|
1
homeassistant/components/xmpp/__init__.py
Normal file
1
homeassistant/components/xmpp/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The xmpp component."""
|
|
@ -19,7 +19,7 @@ from homeassistant.const import (
|
|||
import homeassistant.helpers.config_validation as cv
|
||||
import homeassistant.helpers.template as template_helper
|
||||
|
||||
from . import (
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService)
|
||||
|
||||
REQUIREMENTS = ['slixmpp==1.4.2']
|
1
homeassistant/components/yessssms/__init__.py
Normal file
1
homeassistant/components/yessssms/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""The yessssms component."""
|
|
@ -11,7 +11,8 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_PASSWORD, CONF_RECIPIENT, CONF_USERNAME
|
||||
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']
|
||||
|
|
@ -35,7 +35,7 @@ Adafruit-SHT31==1.0.2
|
|||
# homeassistant.components.homekit
|
||||
HAP-python==2.4.2
|
||||
|
||||
# homeassistant.components.notify.mastodon
|
||||
# homeassistant.components.mastodon.notify
|
||||
Mastodon.py==1.3.1
|
||||
|
||||
# homeassistant.components.github.sensor
|
||||
|
@ -78,7 +78,7 @@ RtmAPI==0.7.0
|
|||
# homeassistant.components.travisci.sensor
|
||||
TravisPy==0.3.5
|
||||
|
||||
# homeassistant.components.notify.twitter
|
||||
# homeassistant.components.twitter.notify
|
||||
TwitterAPI==2.5.9
|
||||
|
||||
# homeassistant.components.tof.sensor
|
||||
|
@ -87,7 +87,7 @@ TwitterAPI==2.5.9
|
|||
# homeassistant.components.waze_travel_time.sensor
|
||||
WazeRouteCalculator==0.9
|
||||
|
||||
# homeassistant.components.notify.yessssms
|
||||
# homeassistant.components.yessssms.notify
|
||||
YesssSMS==0.2.3
|
||||
|
||||
# homeassistant.components.abode
|
||||
|
@ -169,7 +169,7 @@ anthemav==1.1.10
|
|||
# homeassistant.components.apcupsd
|
||||
apcaccess==0.0.13
|
||||
|
||||
# homeassistant.components.notify.apns
|
||||
# homeassistant.components.apns.notify
|
||||
apns2==0.3.0
|
||||
|
||||
# homeassistant.components.aqualogic
|
||||
|
@ -230,9 +230,9 @@ blockchain==1.4.4
|
|||
# bme680==1.0.5
|
||||
|
||||
# homeassistant.components.route53
|
||||
# homeassistant.components.notify.aws_lambda
|
||||
# homeassistant.components.notify.aws_sns
|
||||
# homeassistant.components.notify.aws_sqs
|
||||
# homeassistant.components.aws_lambda.notify
|
||||
# homeassistant.components.aws_sns.notify
|
||||
# homeassistant.components.aws_sqs.notify
|
||||
boto3==1.9.16
|
||||
|
||||
# homeassistant.scripts.credstash
|
||||
|
@ -270,7 +270,7 @@ caldav==0.5.0
|
|||
# homeassistant.components.cisco_mobility_express.device_tracker
|
||||
ciscomobilityexpress==0.1.5
|
||||
|
||||
# homeassistant.components.notify.ciscospark
|
||||
# homeassistant.components.ciscospark.notify
|
||||
ciscosparkapi==0.4.2
|
||||
|
||||
# homeassistant.components.cppm_tracker.device_tracker
|
||||
|
@ -341,7 +341,7 @@ directpy==0.5
|
|||
# homeassistant.components.discogs.sensor
|
||||
discogs_client==2.2.1
|
||||
|
||||
# homeassistant.components.notify.discord
|
||||
# homeassistant.components.discord.notify
|
||||
discord.py==0.16.12
|
||||
|
||||
# homeassistant.components.updater
|
||||
|
@ -443,7 +443,7 @@ flux_led==0.22
|
|||
# homeassistant.components.foobot.sensor
|
||||
foobot_async==0.3.1
|
||||
|
||||
# homeassistant.components.notify.free_mobile
|
||||
# homeassistant.components.free_mobile.notify
|
||||
freesms==0.1.2
|
||||
|
||||
# homeassistant.components.fritz.device_tracker
|
||||
|
@ -477,7 +477,7 @@ gitterpy==0.1.7
|
|||
# homeassistant.components.glances.sensor
|
||||
glances_api==0.2.0
|
||||
|
||||
# homeassistant.components.notify.gntp
|
||||
# homeassistant.components.gntp.notify
|
||||
gntp==1.0.3
|
||||
|
||||
# homeassistant.components.google
|
||||
|
@ -531,7 +531,7 @@ heatmiserV3==0.9.1
|
|||
# homeassistant.components.hikvisioncam.switch
|
||||
hikvision==0.4
|
||||
|
||||
# homeassistant.components.notify.hipchat
|
||||
# homeassistant.components.hipchat.notify
|
||||
hipnotify==1.0.8
|
||||
|
||||
# homeassistant.components.harman_kardon_avr.media_player
|
||||
|
@ -602,7 +602,7 @@ ipify==1.0.0
|
|||
jsonpath==0.75
|
||||
|
||||
# homeassistant.components.kodi.media_player
|
||||
# homeassistant.components.notify.kodi
|
||||
# homeassistant.components.kodi.notify
|
||||
jsonrpc-async==0.6
|
||||
|
||||
# homeassistant.components.kodi.media_player
|
||||
|
@ -690,7 +690,7 @@ maxcube-api==0.1.0
|
|||
# homeassistant.components.mythicbeastsdns
|
||||
mbddns==0.1.2
|
||||
|
||||
# homeassistant.components.notify.message_bird
|
||||
# homeassistant.components.message_bird.notify
|
||||
messagebird==1.2.0
|
||||
|
||||
# homeassistant.components.meteo_france
|
||||
|
@ -876,11 +876,11 @@ psutil==5.6.1
|
|||
# homeassistant.components.wink
|
||||
pubnubsub-handler==1.0.3
|
||||
|
||||
# homeassistant.components.notify.pushbullet
|
||||
# homeassistant.components.pushbullet.notify
|
||||
# homeassistant.components.pushbullet.sensor
|
||||
pushbullet.py==0.11.0
|
||||
|
||||
# homeassistant.components.notify.pushetta
|
||||
# homeassistant.components.pushetta.notify
|
||||
pushetta==1.0.15
|
||||
|
||||
# homeassistant.components.rpi_gpio_pwm.light
|
||||
|
@ -1283,7 +1283,7 @@ pysonos==0.0.8
|
|||
# homeassistant.components.spc
|
||||
pyspcwebgw==0.4.0
|
||||
|
||||
# homeassistant.components.notify.stride
|
||||
# homeassistant.components.stride.notify
|
||||
pystride==0.1.7
|
||||
|
||||
# homeassistant.components.syncthru.sensor
|
||||
|
@ -1338,7 +1338,7 @@ python-hpilo==3.9
|
|||
|
||||
# homeassistant.components.joaoapps_join
|
||||
# homeassistant.components.joaoapps_join.notify
|
||||
python-join-api==0.0.2
|
||||
python-join-api==0.0.4
|
||||
|
||||
# homeassistant.components.juicenet
|
||||
python-juicenet==0.0.5
|
||||
|
@ -1368,7 +1368,7 @@ python-nest==4.1.0
|
|||
# homeassistant.components.nmap_tracker.device_tracker
|
||||
python-nmap==0.6.1
|
||||
|
||||
# homeassistant.components.notify.pushover
|
||||
# homeassistant.components.pushover.notify
|
||||
python-pushover==0.3
|
||||
|
||||
# homeassistant.components.qbittorrent.sensor
|
||||
|
@ -1461,7 +1461,7 @@ pyvizio==0.0.4
|
|||
# homeassistant.components.velux
|
||||
pyvlx==0.2.10
|
||||
|
||||
# homeassistant.components.notify.html5
|
||||
# homeassistant.components.html5.notify
|
||||
pywebpush==1.6.0
|
||||
|
||||
# homeassistant.components.wemo
|
||||
|
@ -1521,7 +1521,7 @@ ritassist==0.9.2
|
|||
# homeassistant.components.rejseplanen.sensor
|
||||
rjpl==0.3.5
|
||||
|
||||
# homeassistant.components.notify.rocketchat
|
||||
# homeassistant.components.rocketchat.notify
|
||||
rocketchat-API==0.6.1
|
||||
|
||||
# homeassistant.components.roomba.vacuum
|
||||
|
@ -1554,7 +1554,7 @@ schiene==0.23
|
|||
# homeassistant.components.scsgate
|
||||
scsgate==0.1.0
|
||||
|
||||
# homeassistant.components.notify.sendgrid
|
||||
# homeassistant.components.sendgrid.notify
|
||||
sendgrid==5.6.0
|
||||
|
||||
# homeassistant.components.sensehat.light
|
||||
|
@ -1570,7 +1570,7 @@ sharp_aquos_rc==0.3.2
|
|||
# homeassistant.components.shodan.sensor
|
||||
shodan==1.11.1
|
||||
|
||||
# homeassistant.components.notify.simplepush
|
||||
# homeassistant.components.simplepush.notify
|
||||
simplepush==1.1.4
|
||||
|
||||
# homeassistant.components.simplisafe
|
||||
|
@ -1582,13 +1582,13 @@ sisyphus-control==2.1
|
|||
# homeassistant.components.skybell
|
||||
skybellpy==0.3.0
|
||||
|
||||
# homeassistant.components.notify.slack
|
||||
# homeassistant.components.slack.notify
|
||||
slacker==0.12.0
|
||||
|
||||
# homeassistant.components.sleepiq
|
||||
sleepyq==0.6
|
||||
|
||||
# homeassistant.components.notify.xmpp
|
||||
# homeassistant.components.xmpp.notify
|
||||
slixmpp==1.4.2
|
||||
|
||||
# homeassistant.components.smappee
|
||||
|
|
|
@ -31,7 +31,7 @@ PyRMVtransport==0.1.3
|
|||
# homeassistant.components.transport_nsw.sensor
|
||||
PyTransportNSW==0.1.1
|
||||
|
||||
# homeassistant.components.notify.yessssms
|
||||
# homeassistant.components.yessssms.notify
|
||||
YesssSMS==0.2.3
|
||||
|
||||
# homeassistant.components.ambient_station
|
||||
|
@ -53,7 +53,7 @@ aiohue==1.9.1
|
|||
# homeassistant.components.unifi
|
||||
aiounifi==4
|
||||
|
||||
# homeassistant.components.notify.apns
|
||||
# homeassistant.components.apns.notify
|
||||
apns2==0.3.0
|
||||
|
||||
# homeassistant.components.stream
|
||||
|
@ -186,7 +186,7 @@ pmsensor==0.4
|
|||
# homeassistant.components.prometheus
|
||||
prometheus_client==0.2.0
|
||||
|
||||
# homeassistant.components.notify.pushbullet
|
||||
# homeassistant.components.pushbullet.notify
|
||||
# homeassistant.components.pushbullet.sensor
|
||||
pushbullet.py==0.11.0
|
||||
|
||||
|
@ -260,7 +260,7 @@ pytradfri[async]==6.0.1
|
|||
# homeassistant.components.unifi.device_tracker
|
||||
pyunifi==2.16
|
||||
|
||||
# homeassistant.components.notify.html5
|
||||
# homeassistant.components.html5.notify
|
||||
pywebpush==1.6.0
|
||||
|
||||
# homeassistant.components.rainmachine
|
||||
|
|
1
tests/components/apns/__init__.py
Normal file
1
tests/components/apns/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""Tests for the apns component."""
|
|
@ -8,7 +8,7 @@ import yaml
|
|||
|
||||
import homeassistant.components.notify as notify
|
||||
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 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):
|
||||
"""Test the APNS component."""
|
||||
|
||||
|
@ -102,7 +102,7 @@ class TestApns(unittest.TestCase):
|
|||
assert setup_component(self.hass, notify.DOMAIN, config)
|
||||
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):
|
||||
"""Test registering a new device with a name."""
|
||||
yaml_file = {5678: {'name': 'test device 2'}}
|
||||
|
@ -116,7 +116,7 @@ class TestApns(unittest.TestCase):
|
|||
mock_write.side_effect = fake_write
|
||||
|
||||
with patch(
|
||||
'homeassistant.components.notify.apns.load_yaml_config_file',
|
||||
'homeassistant.components.apns.notify.load_yaml_config_file',
|
||||
Mock(return_value=yaml_file)):
|
||||
self._setup_notify()
|
||||
|
||||
|
@ -128,7 +128,7 @@ class TestApns(unittest.TestCase):
|
|||
assert len(written_devices) == 1
|
||||
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):
|
||||
"""Test registering a without a name."""
|
||||
yaml_file = {
|
||||
|
@ -151,7 +151,7 @@ class TestApns(unittest.TestCase):
|
|||
mock_write.side_effect = fake_write
|
||||
|
||||
with patch(
|
||||
'homeassistant.components.notify.apns.load_yaml_config_file',
|
||||
'homeassistant.components.apns.notify.load_yaml_config_file',
|
||||
Mock(return_value=yaml_file)):
|
||||
self._setup_notify()
|
||||
|
||||
|
@ -166,7 +166,7 @@ class TestApns(unittest.TestCase):
|
|||
assert test_device is not 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):
|
||||
"""Test updating an existing device."""
|
||||
yaml_file = {
|
||||
|
@ -187,7 +187,7 @@ class TestApns(unittest.TestCase):
|
|||
mock_write.side_effect = fake_write
|
||||
|
||||
with patch(
|
||||
'homeassistant.components.notify.apns.load_yaml_config_file',
|
||||
'homeassistant.components.apns.notify.load_yaml_config_file',
|
||||
Mock(return_value=yaml_file)):
|
||||
self._setup_notify()
|
||||
|
||||
|
@ -206,7 +206,7 @@ class TestApns(unittest.TestCase):
|
|||
|
||||
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):
|
||||
"""Test updating an existing device that has a tracking id."""
|
||||
yaml_file = {
|
||||
|
@ -229,7 +229,7 @@ class TestApns(unittest.TestCase):
|
|||
mock_write.side_effect = fake_write
|
||||
|
||||
with patch(
|
||||
'homeassistant.components.notify.apns.load_yaml_config_file',
|
||||
'homeassistant.components.apns.notify.load_yaml_config_file',
|
||||
Mock(return_value=yaml_file)):
|
||||
self._setup_notify()
|
||||
|
||||
|
@ -259,7 +259,7 @@ class TestApns(unittest.TestCase):
|
|||
yaml_file = {1234: {'name': 'test device 1'}}
|
||||
|
||||
with patch(
|
||||
'homeassistant.components.notify.apns.load_yaml_config_file',
|
||||
'homeassistant.components.apns.notify.load_yaml_config_file',
|
||||
Mock(return_value=yaml_file)):
|
||||
self._setup_notify()
|
||||
|
||||
|
@ -294,7 +294,7 @@ class TestApns(unittest.TestCase):
|
|||
}}
|
||||
|
||||
with patch(
|
||||
'homeassistant.components.notify.apns.load_yaml_config_file',
|
||||
'homeassistant.components.apns.notify.load_yaml_config_file',
|
||||
Mock(return_value=yaml_file)):
|
||||
self._setup_notify()
|
||||
|
||||
|
@ -325,7 +325,7 @@ class TestApns(unittest.TestCase):
|
|||
}
|
||||
|
||||
with patch(
|
||||
'homeassistant.components.notify.apns.load_yaml_config_file',
|
||||
'homeassistant.components.apns.notify.load_yaml_config_file',
|
||||
Mock(return_value=yaml_file)), \
|
||||
patch('os.path.isfile', Mock(return_value=True)):
|
||||
notify_service = apns.ApnsNotificationService(
|
||||
|
@ -353,7 +353,7 @@ class TestApns(unittest.TestCase):
|
|||
assert 'Hello' == payload.alert
|
||||
|
||||
@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):
|
||||
"""Test disabling a device when it is unregistered."""
|
||||
send = mock_client.return_value.send_notification
|
||||
|
@ -379,7 +379,7 @@ class TestApns(unittest.TestCase):
|
|||
mock_write.side_effect = fake_write
|
||||
|
||||
with patch(
|
||||
'homeassistant.components.notify.apns.load_yaml_config_file',
|
||||
'homeassistant.components.apns.notify.load_yaml_config_file',
|
||||
Mock(return_value=yaml_file)):
|
||||
self._setup_notify()
|
||||
|
|
@ -65,7 +65,7 @@ class TestCommandLine(unittest.TestCase):
|
|||
# the echo command adds a line break
|
||||
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):
|
||||
"""Test if an error is logged for non zero exit codes."""
|
||||
with assert_setup_component(1) as handle_config:
|
|
@ -7,7 +7,7 @@ import voluptuous as vol
|
|||
|
||||
import homeassistant.components.notify as notify
|
||||
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.helpers import discovery, script
|
||||
|
||||
|
@ -50,7 +50,7 @@ class TestNotifyDemo(unittest.TestCase):
|
|||
"""Test setup."""
|
||||
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):
|
||||
"""Test missing platform notify service instance."""
|
||||
mock_demo_get_service.return_value = None
|
||||
|
@ -63,7 +63,7 @@ class TestNotifyDemo(unittest.TestCase):
|
|||
['ERROR:homeassistant.components.notify:'
|
||||
'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):
|
||||
"""Test discovery of notify demo platform."""
|
||||
assert notify.DOMAIN not in self.hass.config.components
|
1
tests/components/facebook/__init__.py
Normal file
1
tests/components/facebook/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""Tests for the facebook component."""
|
|
@ -2,7 +2,8 @@
|
|||
import unittest
|
||||
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):
|
|
@ -52,9 +52,9 @@ class TestNotifyFile(unittest.TestCase):
|
|||
|
||||
m_open = mock_open()
|
||||
with patch(
|
||||
'homeassistant.components.notify.file.open',
|
||||
'homeassistant.components.file.notify.open',
|
||||
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',
|
||||
return_value=dt_util.utcnow()):
|
||||
|
|
@ -4,7 +4,8 @@ from unittest.mock import MagicMock, patch
|
|||
|
||||
from homeassistant.setup import setup_component
|
||||
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 tests.common import assert_setup_component, get_test_home_assistant
|
1
tests/components/homematic/__init__.py
Normal file
1
tests/components/homematic/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""Tests for the homematic component."""
|
1
tests/components/html5/__init__.py
Normal file
1
tests/components/html5/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
"""Tests for the html5 component."""
|
|
@ -5,7 +5,7 @@ from aiohttp.hdrs import AUTHORIZATION
|
|||
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.components.notify import html5
|
||||
import homeassistant.components.html5.notify as html5
|
||||
|
||||
CONFIG_FILE = 'file.conf'
|
||||
|
||||
|
@ -54,7 +54,7 @@ async def mock_client(hass, hass_client, registrations=None):
|
|||
if registrations is None:
|
||||
registrations = {}
|
||||
|
||||
with patch('homeassistant.components.notify.html5._load_config',
|
||||
with patch('homeassistant.components.html5.notify._load_config',
|
||||
return_value=registrations):
|
||||
await async_setup_component(hass, 'notify', {
|
||||
'notify': {
|
||||
|
@ -189,7 +189,7 @@ async def test_registering_new_device_view(hass, hass_client):
|
|||
"""Test that the HTML view works."""
|
||||
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))
|
||||
|
||||
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['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))
|
||||
|
||||
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."""
|
||||
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))
|
||||
|
||||
assert resp.status == 200
|
||||
|
@ -234,7 +234,7 @@ async def test_registering_new_device_fails_view(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()):
|
||||
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 = {}
|
||||
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))
|
||||
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['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))
|
||||
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 = {}
|
||||
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))
|
||||
mock_save.side_effect = HomeAssistantError
|
||||
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
|
||||
|
||||
with patch('homeassistant.components.notify.html5.save_json',
|
||||
with patch('homeassistant.components.html5.notify.save_json',
|
||||
return_value=False):
|
||||
resp = await client.post(REGISTER_URL, data=json.dumps({
|
||||
'browser': 'chrome',
|
||||
|
@ -329,7 +329,7 @@ async def test_unregistering_device_view(hass, hass_client):
|
|||
}
|
||||
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({
|
||||
'subscription': SUBSCRIPTION_1['subscription'],
|
||||
}))
|
||||
|
@ -347,7 +347,7 @@ async def test_unregister_device_view_handle_unknown_subscription(
|
|||
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({
|
||||
'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)
|
||||
|
||||
with patch('homeassistant.components.notify.html5.save_json',
|
||||
with patch('homeassistant.components.html5.notify.save_json',
|
||||
side_effect=HomeAssistantError()):
|
||||
resp = await client.delete(REGISTER_URL, data=json.dumps({
|
||||
'subscription': SUBSCRIPTION_1['subscription'],
|
1
tests/components/pushbullet/__init__.py
Normal file
1
tests/components/pushbullet/__init__.py
Normal 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
Loading…
Add table
Reference in a new issue