Tweak services return result (#4600)
* Tweak services return result * Lint
This commit is contained in:
parent
be91207830
commit
e94b4ec006
2 changed files with 4 additions and 4 deletions
|
@ -11,7 +11,7 @@ from voluptuous.humanize import humanize_error
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
MATCH_ALL, EVENT_TIME_CHANGED, EVENT_HOMEASSISTANT_STOP,
|
MATCH_ALL, EVENT_TIME_CHANGED, EVENT_HOMEASSISTANT_STOP,
|
||||||
__version__)
|
__version__)
|
||||||
from homeassistant.components import api, frontend
|
from homeassistant.components import frontend
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
from homeassistant.remote import JSONEncoder
|
from homeassistant.remote import JSONEncoder
|
||||||
from homeassistant.helpers import config_validation as cv
|
from homeassistant.helpers import config_validation as cv
|
||||||
|
@ -400,7 +400,7 @@ class ActiveConnection:
|
||||||
msg = GET_SERVICES_MESSAGE_SCHEMA(msg)
|
msg = GET_SERVICES_MESSAGE_SCHEMA(msg)
|
||||||
|
|
||||||
self.send_message(result_message(msg['id'],
|
self.send_message(result_message(msg['id'],
|
||||||
api.async_services_json(self.hass)))
|
self.hass.services.async_services()))
|
||||||
|
|
||||||
def handle_get_config(self, msg):
|
def handle_get_config(self, msg):
|
||||||
"""Handle get config command."""
|
"""Handle get config command."""
|
||||||
|
|
|
@ -6,7 +6,7 @@ from async_timeout import timeout
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
from homeassistant.components import websocket_api as wapi, api, frontend
|
from homeassistant.components import websocket_api as wapi, frontend
|
||||||
|
|
||||||
from tests.common import mock_http_component_app
|
from tests.common import mock_http_component_app
|
||||||
|
|
||||||
|
@ -249,7 +249,7 @@ def test_get_services(hass, websocket_client):
|
||||||
assert msg['id'] == 5
|
assert msg['id'] == 5
|
||||||
assert msg['type'] == wapi.TYPE_RESULT
|
assert msg['type'] == wapi.TYPE_RESULT
|
||||||
assert msg['success']
|
assert msg['success']
|
||||||
assert msg['result'] == api.async_services_json(hass)
|
assert msg['result'] == hass.services.async_services()
|
||||||
|
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue