Force alias when importing notify PLATFORM_SCHEMA (#120494)
parent
59959141af
commit
4bfecea2f4
|
@ -12,7 +12,7 @@ from homeassistant.components.notify import (
|
|||
ATTR_TARGET,
|
||||
ATTR_TITLE,
|
||||
ATTR_TITLE_DEFAULT,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_URL
|
||||
|
@ -24,7 +24,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
|
||||
CONF_FILE = "config"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Optional(CONF_URL): vol.All(cv.ensure_list, [str]),
|
||||
vol.Optional(CONF_FILE): cv.string,
|
||||
|
|
|
@ -9,7 +9,7 @@ from webexteamssdk import ApiError, WebexTeamsAPI, exceptions
|
|||
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_TITLE,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_TOKEN
|
||||
|
@ -21,7 +21,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
|
||||
CONF_ROOM_ID = "room_id"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{vol.Required(CONF_TOKEN): cv.string, vol.Required(CONF_ROOM_ID): cv.string}
|
||||
)
|
||||
|
||||
|
|
|
@ -9,7 +9,10 @@ from typing import Any
|
|||
import requests
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService
|
||||
from homeassistant.components.notify import (
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_API_KEY, CONF_RECIPIENT
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
@ -21,7 +24,7 @@ DEFAULT_NAME = "clickatell"
|
|||
|
||||
BASE_API_URL = "https://platform.clickatell.com/messages/http/send"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{vol.Required(CONF_API_KEY): cv.string, vol.Required(CONF_RECIPIENT): cv.string}
|
||||
)
|
||||
|
||||
|
|
|
@ -10,7 +10,10 @@ from typing import Any
|
|||
import requests
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService
|
||||
from homeassistant.components.notify import (
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
CONF_API_KEY,
|
||||
CONF_RECIPIENT,
|
||||
|
@ -31,19 +34,13 @@ TIMEOUT = 5
|
|||
HEADERS = {"Content-Type": CONTENT_TYPE_JSON}
|
||||
|
||||
|
||||
PLATFORM_SCHEMA = vol.Schema(
|
||||
vol.All(
|
||||
PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_USERNAME): cv.string,
|
||||
vol.Required(CONF_API_KEY): cv.string,
|
||||
vol.Required(CONF_RECIPIENT, default=[]): vol.All(
|
||||
cv.ensure_list, [cv.string]
|
||||
),
|
||||
vol.Optional(CONF_SENDER, default=DEFAULT_SENDER): cv.string,
|
||||
}
|
||||
)
|
||||
)
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_USERNAME): cv.string,
|
||||
vol.Required(CONF_API_KEY): cv.string,
|
||||
vol.Required(CONF_RECIPIENT, default=[]): vol.All(cv.ensure_list, [cv.string]),
|
||||
vol.Optional(CONF_SENDER, default=DEFAULT_SENDER): cv.string,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -9,7 +9,10 @@ import logging
|
|||
import requests
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService
|
||||
from homeassistant.components.notify import (
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
CONF_API_KEY,
|
||||
CONF_NAME,
|
||||
|
@ -38,7 +41,7 @@ DEFAULT_LANGUAGE = "en-us"
|
|||
DEFAULT_VOICE = FEMALE_VOICE
|
||||
TIMEOUT = 5
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
|
||||
vol.Required(CONF_USERNAME): cv.string,
|
||||
|
|
|
@ -12,7 +12,7 @@ import voluptuous as vol
|
|||
from homeassistant.components.notify import (
|
||||
ATTR_DATA,
|
||||
ATTR_TARGET,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONTENT_TYPE_JSON
|
||||
|
@ -25,7 +25,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
CONF_PAGE_ACCESS_TOKEN = "page_access_token"
|
||||
BASE_URL = "https://graph.facebook.com/v2.6/me/messages"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{vol.Required(CONF_PAGE_ACCESS_TOKEN): cv.string}
|
||||
)
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import voluptuous as vol
|
|||
from homeassistant.components.notify import (
|
||||
ATTR_TITLE,
|
||||
ATTR_TITLE_DEFAULT,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
NotifyEntity,
|
||||
NotifyEntityFeature,
|
||||
|
@ -34,7 +34,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
|
||||
# The legacy platform schema uses a filename, after import
|
||||
# The full file path is stored in the config entry
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_FILENAME): cv.string,
|
||||
vol.Optional(CONF_TIMESTAMP, default=False): cv.boolean,
|
||||
|
|
|
@ -8,7 +8,10 @@ import logging
|
|||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService
|
||||
from homeassistant.components.notify import (
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_ACCESS_TOKEN
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
|
@ -18,7 +21,9 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
|||
_LOGGER = logging.getLogger(__name__)
|
||||
_RESOURCE = "https://api.flock.com/hooks/sendMessage/"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({vol.Required(CONF_ACCESS_TOKEN): cv.string})
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{vol.Required(CONF_ACCESS_TOKEN): cv.string}
|
||||
)
|
||||
|
||||
|
||||
async def async_get_service(
|
||||
|
|
|
@ -8,7 +8,10 @@ import logging
|
|||
from freesms import FreeClient
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService
|
||||
from homeassistant.components.notify import (
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_USERNAME
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
@ -16,7 +19,7 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
|||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{vol.Required(CONF_USERNAME): cv.string, vol.Required(CONF_ACCESS_TOKEN): cv.string}
|
||||
)
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ from homeassistant.components.notify import (
|
|||
ATTR_DATA,
|
||||
ATTR_MESSAGE,
|
||||
DOMAIN,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import ATTR_SERVICE
|
||||
|
@ -23,7 +23,7 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
|||
|
||||
CONF_SERVICES = "services"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_SERVICES): vol.All(
|
||||
cv.ensure_list,
|
||||
|
|
|
@ -6,7 +6,7 @@ import voluptuous as vol
|
|||
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
@ -24,7 +24,7 @@ from .const import (
|
|||
SERVICE_SET_DEVICE_VALUE,
|
||||
)
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(ATTR_ADDRESS): vol.All(cv.string, vol.Upper),
|
||||
vol.Required(ATTR_CHANNEL): vol.Coerce(int),
|
||||
|
|
|
@ -26,7 +26,7 @@ from homeassistant.components.notify import (
|
|||
ATTR_TARGET,
|
||||
ATTR_TITLE,
|
||||
ATTR_TITLE_DEFAULT,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import ATTR_NAME, URL_ROOT
|
||||
|
@ -61,7 +61,7 @@ def gcm_api_deprecated(value):
|
|||
return value
|
||||
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Optional("gcm_sender_id"): vol.All(cv.string, gcm_api_deprecated),
|
||||
vol.Optional("gcm_api_key"): cv.string,
|
||||
|
|
|
@ -11,7 +11,7 @@ from homeassistant.components.notify import (
|
|||
ATTR_DATA,
|
||||
ATTR_TITLE,
|
||||
ATTR_TITLE_DEFAULT,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_API_KEY, CONF_DEVICE_ID
|
||||
|
@ -24,7 +24,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
CONF_DEVICE_IDS = "device_ids"
|
||||
CONF_DEVICE_NAMES = "device_names"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_API_KEY): cv.string,
|
||||
vol.Optional(CONF_DEVICE_ID): cv.string,
|
||||
|
|
|
@ -12,7 +12,7 @@ from homeassistant.components.notify import (
|
|||
ATTR_DATA,
|
||||
ATTR_TITLE,
|
||||
ATTR_TITLE_DEFAULT,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
|
@ -34,7 +34,7 @@ DEFAULT_PORT = 8080
|
|||
DEFAULT_PROXY_SSL = False
|
||||
DEFAULT_TIMEOUT = 5
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_HOST): cv.string,
|
||||
vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
|
||||
|
|
|
@ -10,7 +10,7 @@ import voluptuous as vol
|
|||
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_HOST, CONF_PORT
|
||||
|
@ -24,7 +24,7 @@ ATTR_METHOD_ALLOWED = ["speak", "alarm"]
|
|||
|
||||
DEFAULT_PORT = 1035
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_HOST): cv.string,
|
||||
vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
|
||||
|
|
|
@ -10,7 +10,7 @@ import voluptuous as vol
|
|||
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_API_KEY, CONF_DEVICE
|
||||
|
@ -25,7 +25,7 @@ ATTR_PRIORITY = "priority"
|
|||
|
||||
CONF_TO = "to"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_API_KEY): cv.string,
|
||||
vol.Required(CONF_TO): cv.string,
|
||||
|
|
|
@ -16,7 +16,7 @@ from homeassistant.components.notify import (
|
|||
ATTR_DATA,
|
||||
ATTR_TITLE,
|
||||
ATTR_TITLE_DEFAULT,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_API_KEY, CONF_DOMAIN, CONF_RECIPIENT, CONF_SENDER
|
||||
|
@ -32,7 +32,7 @@ ATTR_IMAGES = "images"
|
|||
|
||||
DEFAULT_SANDBOX = False
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{vol.Required(CONF_RECIPIENT): vol.Email(), vol.Optional(CONF_SENDER): vol.Email()}
|
||||
)
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import voluptuous as vol
|
|||
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_CLIENT_ID, CONF_CLIENT_SECRET
|
||||
|
@ -26,7 +26,7 @@ ATTR_TARGET = "target"
|
|||
ATTR_MEDIA_WARNING = "media_warning"
|
||||
ATTR_CONTENT_WARNING = "content_warning"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_ACCESS_TOKEN): cv.string,
|
||||
vol.Required(CONF_CLIENT_ID): cv.string,
|
||||
|
|
|
@ -10,7 +10,7 @@ from homeassistant.components.notify import (
|
|||
ATTR_DATA,
|
||||
ATTR_MESSAGE,
|
||||
ATTR_TARGET,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
@ -22,7 +22,9 @@ from .const import DOMAIN, SERVICE_SEND_MESSAGE
|
|||
|
||||
CONF_DEFAULT_ROOM = "default_room"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({vol.Required(CONF_DEFAULT_ROOM): cv.string})
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{vol.Required(CONF_DEFAULT_ROOM): cv.string}
|
||||
)
|
||||
|
||||
|
||||
def get_service(
|
||||
|
|
|
@ -10,7 +10,7 @@ import voluptuous as vol
|
|||
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_TARGET,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_API_KEY, CONF_SENDER
|
||||
|
@ -20,7 +20,7 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
|||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_API_KEY): cv.string,
|
||||
vol.Optional(CONF_SENDER, default="HA"): vol.All(
|
||||
|
|
|
@ -11,7 +11,7 @@ from homeassistant.components.notify import (
|
|||
ATTR_DATA,
|
||||
ATTR_TITLE,
|
||||
ATTR_TITLE_DEFAULT,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_URL
|
||||
|
@ -23,7 +23,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
|
||||
ATTR_FILE_URL = "image_url"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({vol.Required(CONF_URL): cv.url})
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend({vol.Required(CONF_URL): cv.url})
|
||||
|
||||
|
||||
def get_service(
|
||||
|
|
|
@ -12,7 +12,7 @@ from homeassistant.components.notify import (
|
|||
ATTR_DATA,
|
||||
ATTR_TITLE,
|
||||
ATTR_TITLE_DEFAULT,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_API_KEY
|
||||
|
@ -24,7 +24,7 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
|||
_LOGGER = logging.getLogger(__name__)
|
||||
_RESOURCE = "https://api.prowlapp.com/publicapi/"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({vol.Required(CONF_API_KEY): cv.string})
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend({vol.Required(CONF_API_KEY): cv.string})
|
||||
|
||||
|
||||
async def async_get_service(
|
||||
|
|
|
@ -16,7 +16,7 @@ from homeassistant.components.notify import (
|
|||
ATTR_TARGET,
|
||||
ATTR_TITLE,
|
||||
ATTR_TITLE_DEFAULT,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import ATTR_ICON
|
||||
|
@ -54,7 +54,9 @@ ATTR_PICTURE1_USERNAME = "username"
|
|||
ATTR_PICTURE1_PASSWORD = "password"
|
||||
ATTR_PICTURE1_AUTH = "auth"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({vol.Required(CONF_DEVICE_KEY): cv.string})
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{vol.Required(CONF_DEVICE_KEY): cv.string}
|
||||
)
|
||||
|
||||
|
||||
def get_service(
|
||||
|
|
|
@ -14,7 +14,7 @@ from homeassistant.components.notify import (
|
|||
ATTR_TARGET,
|
||||
ATTR_TITLE,
|
||||
ATTR_TITLE_DEFAULT,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
|
@ -45,7 +45,7 @@ DEFAULT_MESSAGE_PARAM_NAME = "message"
|
|||
DEFAULT_METHOD = "GET"
|
||||
DEFAULT_VERIFY_SSL = True
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_RESOURCE): cv.url,
|
||||
vol.Optional(
|
||||
|
|
|
@ -14,7 +14,7 @@ import voluptuous as vol
|
|||
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_PASSWORD, CONF_ROOM, CONF_URL, CONF_USERNAME
|
||||
|
@ -24,7 +24,7 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
|||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_URL): vol.Url(),
|
||||
vol.Required(CONF_USERNAME): cv.string,
|
||||
|
|
|
@ -11,7 +11,7 @@ import voluptuous as vol
|
|||
from homeassistant.components.notify import (
|
||||
ATTR_TITLE,
|
||||
ATTR_TITLE_DEFAULT,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
|
@ -30,7 +30,7 @@ CONF_SENDER_NAME = "sender_name"
|
|||
|
||||
DEFAULT_SENDER_NAME = "Home Assistant"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_API_KEY): cv.string,
|
||||
vol.Required(CONF_SENDER): vol.Email(),
|
||||
|
|
|
@ -11,7 +11,7 @@ import voluptuous as vol
|
|||
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
@ -57,7 +57,7 @@ DATA_SCHEMA = vol.Any(
|
|||
DATA_URLS_SCHEMA,
|
||||
)
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_SENDER_NR): cv.string,
|
||||
vol.Required(CONF_SIGNAL_CLI_REST_API): cv.string,
|
||||
|
|
|
@ -18,7 +18,7 @@ from homeassistant.components.notify import (
|
|||
ATTR_DATA,
|
||||
ATTR_MESSAGE,
|
||||
ATTR_TARGET,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_API_KEY, CONF_SENDER
|
||||
|
@ -37,7 +37,7 @@ DEFAULT_SENDER = "Home Assistant"
|
|||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_API_KEY): cv.string,
|
||||
vol.Required(CONF_SERVICE_PLAN_ID): cv.string,
|
||||
|
|
|
@ -19,7 +19,7 @@ from homeassistant.components.notify import (
|
|||
ATTR_TARGET,
|
||||
ATTR_TITLE,
|
||||
ATTR_TITLE_DEFAULT,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
|
@ -60,7 +60,7 @@ PLATFORMS = [Platform.NOTIFY]
|
|||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_RECIPIENT): vol.All(cv.ensure_list, [vol.Email()]),
|
||||
vol.Required(CONF_SENDER): vol.Email(),
|
||||
|
|
|
@ -11,7 +11,7 @@ import voluptuous as vol
|
|||
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_RESOURCE, CONF_VERIFY_SSL
|
||||
|
@ -21,7 +21,7 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
|||
|
||||
ATTR_FILE_URL = "file_url"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_RESOURCE): cv.url,
|
||||
vol.Optional(CONF_VERIFY_SSL, default=True): cv.boolean,
|
||||
|
|
|
@ -9,7 +9,7 @@ import voluptuous as vol
|
|||
from homeassistant.components.notify import (
|
||||
ATTR_TITLE,
|
||||
ATTR_TITLE_DEFAULT,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
@ -59,7 +59,7 @@ SYSLOG_PRIORITY = {
|
|||
-2: "LOG_DEBUG",
|
||||
}
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Optional(CONF_FACILITY, default="syslog"): vol.In(SYSLOG_FACILITY.keys()),
|
||||
vol.Optional(CONF_OPTION, default="pid"): vol.In(SYSLOG_OPTION.keys()),
|
||||
|
|
|
@ -11,7 +11,7 @@ from homeassistant.components.notify import (
|
|||
ATTR_MESSAGE,
|
||||
ATTR_TARGET,
|
||||
ATTR_TITLE,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.components.telegram_bot import (
|
||||
|
@ -40,7 +40,9 @@ ATTR_DOCUMENT = "document"
|
|||
|
||||
CONF_CHAT_ID = "chat_id"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({vol.Required(CONF_CHAT_ID): vol.Coerce(int)})
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{vol.Required(CONF_CHAT_ID): vol.Coerce(int)}
|
||||
)
|
||||
|
||||
|
||||
def get_service(
|
||||
|
|
|
@ -10,7 +10,7 @@ import voluptuous as vol
|
|||
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_TARGET,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.components.twilio import DATA_TWILIO
|
||||
|
@ -22,7 +22,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
|
||||
CONF_FROM_NUMBER = "from_number"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_FROM_NUMBER): vol.All(
|
||||
cv.string, vol.Match(r"^\+?[1-9]\d{1,14}$")
|
||||
|
|
|
@ -9,7 +9,7 @@ import voluptuous as vol
|
|||
from homeassistant.components.notify import (
|
||||
ATTR_DATA,
|
||||
ATTR_TARGET,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.components.twilio import DATA_TWILIO
|
||||
|
@ -22,7 +22,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
CONF_FROM_NUMBER = "from_number"
|
||||
ATTR_MEDIAURL = "media_url"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_FROM_NUMBER): vol.All(
|
||||
cv.string,
|
||||
|
|
|
@ -16,7 +16,7 @@ import voluptuous as vol
|
|||
from homeassistant.components.notify import (
|
||||
ATTR_DATA,
|
||||
ATTR_TARGET,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_USERNAME
|
||||
|
@ -33,7 +33,7 @@ CONF_ACCESS_TOKEN_SECRET = "access_token_secret"
|
|||
|
||||
ATTR_MEDIA = "media"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_ACCESS_TOKEN): cv.string,
|
||||
vol.Required(CONF_ACCESS_TOKEN_SECRET): cv.string,
|
||||
|
|
|
@ -24,7 +24,7 @@ import voluptuous as vol
|
|||
from homeassistant.components.notify import (
|
||||
ATTR_TITLE,
|
||||
ATTR_TITLE_DEFAULT,
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
|
@ -56,7 +56,7 @@ DEFAULT_CONTENT_TYPE = "application/octet-stream"
|
|||
DEFAULT_RESOURCE = "home-assistant"
|
||||
XEP_0363_TIMEOUT = 10
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
PLATFORM_SCHEMA = NOTIFY_PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_SENDER): cv.string,
|
||||
vol.Required(CONF_PASSWORD): cv.string,
|
||||
|
|
|
@ -811,6 +811,7 @@ ignore = [
|
|||
|
||||
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
|
||||
voluptuous = "vol"
|
||||
"homeassistant.components.notify.PLATFORM_SCHEMA" = "NOTIFY_PLATFORM_SCHEMA"
|
||||
"homeassistant.helpers.area_registry" = "ar"
|
||||
"homeassistant.helpers.category_registry" = "cr"
|
||||
"homeassistant.helpers.config_validation" = "cv"
|
||||
|
|
Loading…
Reference in New Issue