Support to use Whatsapp numbers (fixes ##28065) (#28078)
parent
77d55a3b15
commit
acee87bef6
homeassistant/components
|
@ -1,9 +1,12 @@
|
|||
"""Support for Twilio."""
|
||||
from twilio.rest import Client
|
||||
from twilio.twiml import TwiML
|
||||
import voluptuous as vol
|
||||
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.const import CONF_WEBHOOK_ID
|
||||
from homeassistant.helpers import config_entry_flow
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from .const import DOMAIN
|
||||
|
||||
CONF_ACCOUNT_SID = "account_sid"
|
||||
|
@ -28,8 +31,6 @@ CONFIG_SCHEMA = vol.Schema(
|
|||
|
||||
async def async_setup(hass, config):
|
||||
"""Set up the Twilio component."""
|
||||
from twilio.rest import Client
|
||||
|
||||
if DOMAIN not in config:
|
||||
return True
|
||||
|
||||
|
@ -42,8 +43,6 @@ async def async_setup(hass, config):
|
|||
|
||||
async def handle_webhook(hass, webhook_id, request):
|
||||
"""Handle incoming webhook from Twilio for inbound messages and calls."""
|
||||
from twilio.twiml import TwiML
|
||||
|
||||
data = dict(await request.post())
|
||||
data["webhook_id"] = webhook_id
|
||||
hass.bus.async_fire(RECEIVED_DATA, dict(data))
|
||||
|
|
|
@ -3,7 +3,6 @@ from homeassistant.helpers import config_entry_flow
|
|||
|
||||
from .const import DOMAIN
|
||||
|
||||
|
||||
config_entry_flow.register_webhook_flow(
|
||||
DOMAIN,
|
||||
"Twilio Webhook",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"config_flow": true,
|
||||
"documentation": "https://www.home-assistant.io/integrations/twilio",
|
||||
"requirements": [
|
||||
"twilio==6.19.1"
|
||||
"twilio==6.32.0"
|
||||
],
|
||||
"dependencies": [
|
||||
"webhook"
|
||||
|
|
|
@ -4,14 +4,13 @@ import urllib
|
|||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.twilio import DATA_TWILIO
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_TARGET,
|
||||
PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.components.twilio import DATA_TWILIO
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -3,15 +3,14 @@ import logging
|
|||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.twilio import DATA_TWILIO
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA,
|
||||
ATTR_TARGET,
|
||||
PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
ATTR_DATA,
|
||||
)
|
||||
from homeassistant.components.twilio import DATA_TWILIO
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -26,6 +25,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|||
r"^\+?[1-9]\d{1,14}$|"
|
||||
r"^(?=.{1,11}$)[a-zA-Z0-9\s]*"
|
||||
r"[a-zA-Z][a-zA-Z0-9\s]*$"
|
||||
r"^(?:[a-zA-Z]+)\:?\+?[1-9]\d{1,14}$|"
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1909,7 +1909,7 @@ tuyaha==0.0.4
|
|||
twentemilieu==0.1.0
|
||||
|
||||
# homeassistant.components.twilio
|
||||
twilio==6.19.1
|
||||
twilio==6.32.0
|
||||
|
||||
# homeassistant.components.upcloud
|
||||
upcloud-api==0.4.3
|
||||
|
|
|
@ -596,7 +596,7 @@ transmissionrpc==0.11
|
|||
twentemilieu==0.1.0
|
||||
|
||||
# homeassistant.components.twilio
|
||||
twilio==6.19.1
|
||||
twilio==6.32.0
|
||||
|
||||
# homeassistant.components.uvc
|
||||
uvcclient==0.11.0
|
||||
|
|
Loading…
Reference in New Issue