Alexa sync state report (#24835)
* Do a sync after changing state reporting * Fix entity config being None
This commit is contained in:
1 parent
6cbfc63311
commit
cc75adfed6
4 files changed
+187
-158
No files matched your search
@@ -1,9 +1,10 @@
|
||||
"""Fixtures for cloud tests."""
|
||||
import pytest
|
||||
|
||||
from unittest.mock import patch
|
||||
|
||||
from homeassistant.components.cloud import prefs
|
||||
import jwt
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.cloud import const, prefs
|
||||
|
||||
from . import mock_cloud, mock_cloud_prefs
|
||||
|
||||
@@ -28,3 +29,19 @@ async def cloud_prefs(hass):
|
||||
cloud_prefs = prefs.CloudPreferences(hass)
|
||||
await cloud_prefs.async_initialize()
|
||||
return cloud_prefs
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def mock_cloud_setup(hass):
|
||||
"""Set up the cloud."""
|
||||
await mock_cloud(hass)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_cloud_login(hass, mock_cloud_setup):
|
||||
"""Mock cloud is logged in."""
|
||||
hass.data[const.DOMAIN].id_token = jwt.encode({
|
||||
'email': 'hello@home-assistant.io',
|
||||
'custom:sub-exp': '2018-01-03',
|
||||
'cognito:username': 'abcdefghjkl',
|
||||
}, 'test')
|
||||
Reference in new issue
Block a user