mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Deprecate event forwarding
This commit is contained in:
parent
97b9d3bd21
commit
e94aa3afe9
@ -327,6 +327,8 @@ class APIEventForwardingView(HomeAssistantView):
|
|||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
"""Setup an event forwarder."""
|
"""Setup an event forwarder."""
|
||||||
|
_LOGGER.warning('Event forwarding is deprecated. '
|
||||||
|
'Will be removed by 0.43')
|
||||||
hass = request.app['hass']
|
hass = request.app['hass']
|
||||||
try:
|
try:
|
||||||
data = yield from request.json()
|
data = yield from request.json()
|
||||||
|
@ -122,6 +122,8 @@ class HomeAssistant(ha.HomeAssistant):
|
|||||||
# pylint: disable=super-init-not-called
|
# pylint: disable=super-init-not-called
|
||||||
def __init__(self, remote_api, local_api=None, loop=None):
|
def __init__(self, remote_api, local_api=None, loop=None):
|
||||||
"""Initalize the forward instance."""
|
"""Initalize the forward instance."""
|
||||||
|
_LOGGER.warning('Remote instances of Home Assistant are deprecated. '
|
||||||
|
'Will be removed by 0.43')
|
||||||
if not remote_api.validate_api():
|
if not remote_api.validate_api():
|
||||||
raise HomeAssistantError(
|
raise HomeAssistantError(
|
||||||
"Remote API at {}:{} not valid: {}".format(
|
"Remote API at {}:{} not valid: {}".format(
|
||||||
@ -215,6 +217,9 @@ class EventForwarder(object):
|
|||||||
|
|
||||||
def __init__(self, hass, restrict_origin=None):
|
def __init__(self, hass, restrict_origin=None):
|
||||||
"""Initalize the event forwarder."""
|
"""Initalize the event forwarder."""
|
||||||
|
_LOGGER.warning('API forwarding is deprecated. '
|
||||||
|
'Will be removed by 0.43')
|
||||||
|
|
||||||
self.hass = hass
|
self.hass = hass
|
||||||
self.restrict_origin = restrict_origin
|
self.restrict_origin = restrict_origin
|
||||||
|
|
||||||
@ -349,6 +354,8 @@ def validate_api(api):
|
|||||||
|
|
||||||
def connect_remote_events(from_api, to_api):
|
def connect_remote_events(from_api, to_api):
|
||||||
"""Setup from_api to forward all events to to_api."""
|
"""Setup from_api to forward all events to to_api."""
|
||||||
|
_LOGGER.warning('Event forwarding is deprecated. '
|
||||||
|
'Will be removed by 0.43')
|
||||||
data = {
|
data = {
|
||||||
'host': to_api.host,
|
'host': to_api.host,
|
||||||
'api_password': to_api.api_password,
|
'api_password': to_api.api_password,
|
||||||
@ -374,6 +381,8 @@ def connect_remote_events(from_api, to_api):
|
|||||||
|
|
||||||
def disconnect_remote_events(from_api, to_api):
|
def disconnect_remote_events(from_api, to_api):
|
||||||
"""Disconnect forwarding events from from_api to to_api."""
|
"""Disconnect forwarding events from from_api to to_api."""
|
||||||
|
_LOGGER.warning('Event forwarding is deprecated. '
|
||||||
|
'Will be removed by 0.43')
|
||||||
data = {
|
data = {
|
||||||
'host': to_api.host,
|
'host': to_api.host,
|
||||||
'port': to_api.port
|
'port': to_api.port
|
||||||
|
Loading…
x
Reference in New Issue
Block a user