From c37cd835b9a219aa695a941e8f1fbc816ce5d91c Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 14 Jun 2020 07:29:33 +0200 Subject: [PATCH 1/9] Upgrade wled 0.4.3 (#36760) --- homeassistant/components/wled/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/wled/manifest.json b/homeassistant/components/wled/manifest.json index 1653ecf1365..e7cc99813cb 100644 --- a/homeassistant/components/wled/manifest.json +++ b/homeassistant/components/wled/manifest.json @@ -3,7 +3,7 @@ "name": "WLED", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/wled", - "requirements": ["wled==0.4.2"], + "requirements": ["wled==0.4.3"], "zeroconf": ["_wled._tcp.local."], "codeowners": ["@frenck"], "quality_scale": "platinum" diff --git a/requirements_all.txt b/requirements_all.txt index cbe56487d0a..dfb1a8c069c 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2195,7 +2195,7 @@ wirelesstagpy==0.4.0 withings-api==2.1.3 # homeassistant.components.wled -wled==0.4.2 +wled==0.4.3 # homeassistant.components.xbee xbee-helper==0.0.7 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 13311b31fa6..e2995912dd4 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -901,7 +901,7 @@ wiffi==1.0.0 withings-api==2.1.3 # homeassistant.components.wled -wled==0.4.2 +wled==0.4.3 # homeassistant.components.bluesound # homeassistant.components.rest From d0ca8e62a4c37bfa1ed434ceadcae984a76e37c0 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 13 Jun 2020 23:22:16 -0500 Subject: [PATCH 2/9] Fix history graphs with mysql/mariadb (#36769) --- homeassistant/components/history/__init__.py | 10 ++++------ tests/components/history/test_init.py | 5 +---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/history/__init__.py b/homeassistant/components/history/__init__.py index 43ae21fea50..06b26cce362 100644 --- a/homeassistant/components/history/__init__.py +++ b/homeassistant/components/history/__init__.py @@ -12,11 +12,7 @@ import voluptuous as vol from homeassistant.components import recorder from homeassistant.components.http import HomeAssistantView -from homeassistant.components.recorder.models import ( - DB_TIMEZONE, - States, - process_timestamp, -) +from homeassistant.components.recorder.models import States, process_timestamp from homeassistant.components.recorder.util import execute, session_scope from homeassistant.const import ( ATTR_HIDDEN, @@ -355,7 +351,9 @@ def _sorted_states_to_json( ent_results.append( { STATE_KEY: db_state.state, - LAST_CHANGED_KEY: f"{str(_process_timestamp(db_state.last_changed)).replace(' ','T').split('.')[0]}{DB_TIMEZONE}", + LAST_CHANGED_KEY: _process_timestamp( + db_state.last_changed + ).isoformat(), } ) prev_state = db_state diff --git a/tests/components/history/test_init.py b/tests/components/history/test_init.py index ba0e0b9f1c0..de449b02c74 100644 --- a/tests/components/history/test_init.py +++ b/tests/components/history/test_init.py @@ -222,11 +222,8 @@ class TestComponentHistory(unittest.TestCase): # will happen with encoding a native state input_state = states["media_player.test"][1] orig_last_changed = json.dumps( - process_timestamp(input_state.last_changed.replace(microsecond=0)), - cls=JSONEncoder, + process_timestamp(input_state.last_changed), cls=JSONEncoder, ).replace('"', "") - if orig_last_changed.endswith("+00:00"): - orig_last_changed = f"{orig_last_changed[:-6]}{recorder.models.DB_TIMEZONE}" orig_state = input_state.state states["media_player.test"][1] = { "last_changed": orig_last_changed, From 12781bf8428fa2250acf945622af07a96f93e468 Mon Sep 17 00:00:00 2001 From: N1c093 <59510296+N1c093@users.noreply.github.com> Date: Mon, 15 Jun 2020 18:17:54 +0200 Subject: [PATCH 3/9] Fix nanoleaf attribute when running an effect (#36794) --- homeassistant/components/nanoleaf/light.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/nanoleaf/light.py b/homeassistant/components/nanoleaf/light.py index a7bf75a15d2..ed1e4877a31 100644 --- a/homeassistant/components/nanoleaf/light.py +++ b/homeassistant/components/nanoleaf/light.py @@ -230,7 +230,6 @@ class NanoleafLight(LightEntity): try: self._available = self._light.available self._brightness = self._light.brightness - self._color_temp = self._light.color_temperature self._effects_list = self._light.effects # Nanoleaf api returns non-existent effect named "*Solid*" when light set to solid color. # This causes various issues with scening (see https://github.com/home-assistant/core/issues/36359). @@ -238,7 +237,12 @@ class NanoleafLight(LightEntity): self._effect = ( self._light.effect if self._light.effect in self._effects_list else None ) - self._hs_color = self._light.hue, self._light.saturation + if self._effect is None: + self._color_temp = self._light.color_temperature + self._hs_color = self._light.hue, self._light.saturation + else: + self._color_temp = None + self._hs_color = None self._state = self._light.on except Unavailable as err: _LOGGER.error("Could not update status for %s (%s)", self.name, err) From b45e49902c13623d590cdbe3d13a525cf67c9487 Mon Sep 17 00:00:00 2001 From: "David F. Mulcahey" Date: Sun, 14 Jun 2020 14:47:36 -0400 Subject: [PATCH 4/9] Bump ZHA quirks (#36797) --- homeassistant/components/zha/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/zha/manifest.json b/homeassistant/components/zha/manifest.json index 63a87932ba9..421162eb9dd 100644 --- a/homeassistant/components/zha/manifest.json +++ b/homeassistant/components/zha/manifest.json @@ -6,7 +6,7 @@ "requirements": [ "bellows==0.16.2", "pyserial==3.4", - "zha-quirks==0.0.39", + "zha-quirks==0.0.40", "zigpy-cc==0.4.4", "zigpy-deconz==0.9.2", "zigpy==0.20.4", diff --git a/requirements_all.txt b/requirements_all.txt index dfb1a8c069c..44d991e5923 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2242,7 +2242,7 @@ zengge==0.2 zeroconf==0.27.1 # homeassistant.components.zha -zha-quirks==0.0.39 +zha-quirks==0.0.40 # homeassistant.components.zhong_hong zhong_hong_hvac==1.0.9 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index e2995912dd4..f069566d7c0 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -918,7 +918,7 @@ ya_ma==0.3.8 zeroconf==0.27.1 # homeassistant.components.zha -zha-quirks==0.0.39 +zha-quirks==0.0.40 # homeassistant.components.zha zigpy-cc==0.4.4 From ec65ebacd3641ce0d5106e364128d65314bbc78f Mon Sep 17 00:00:00 2001 From: Tom Harris Date: Mon, 15 Jun 2020 07:49:39 -0400 Subject: [PATCH 5/9] Fix X10 devices and adding default links (#36807) --- homeassistant/components/insteon/insteon_entity.py | 2 +- homeassistant/components/insteon/manifest.json | 2 +- requirements_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/insteon/insteon_entity.py b/homeassistant/components/insteon/insteon_entity.py index 787c64ec841..1626482a80e 100644 --- a/homeassistant/components/insteon/insteon_entity.py +++ b/homeassistant/components/insteon/insteon_entity.py @@ -124,4 +124,4 @@ class InsteonEntity(Entity): async def _async_add_default_links(self): """Add default links between the device and the modem.""" - await self._insteon_device.async_add_default_links(self.address) + await self._insteon_device.async_add_default_links() diff --git a/homeassistant/components/insteon/manifest.json b/homeassistant/components/insteon/manifest.json index 63c258d5f58..70a7375d51f 100644 --- a/homeassistant/components/insteon/manifest.json +++ b/homeassistant/components/insteon/manifest.json @@ -2,6 +2,6 @@ "domain": "insteon", "name": "Insteon", "documentation": "https://www.home-assistant.io/integrations/insteon", - "requirements": ["pyinsteon==1.0.3"], + "requirements": ["pyinsteon==1.0.4"], "codeowners": ["@teharris1"] } \ No newline at end of file diff --git a/requirements_all.txt b/requirements_all.txt index 44d991e5923..8bcacf7330b 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1375,7 +1375,7 @@ pyialarm==0.3 pyicloud==0.9.7 # homeassistant.components.insteon -pyinsteon==1.0.3 +pyinsteon==1.0.4 # homeassistant.components.intesishome pyintesishome==1.7.4 From 3a2138131c1026c54e15c4f125192ad2a1002677 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 15 Jun 2020 15:22:53 -0700 Subject: [PATCH 6/9] Fire config changed event during start (#36812) --- homeassistant/components/hassio/__init__.py | 12 +++++++- homeassistant/core.py | 9 +++--- tests/components/hassio/test_discovery.py | 2 +- tests/test_core.py | 34 +++++++++++++++++++++ 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/hassio/__init__.py b/homeassistant/components/hassio/__init__.py index 0bd766589a1..6939c1f7073 100644 --- a/homeassistant/components/hassio/__init__.py +++ b/homeassistant/components/hassio/__init__.py @@ -249,9 +249,19 @@ async def async_setup(hass, config): await hassio.update_hass_api(config.get("http", {}), refresh_token) + last_timezone = None + async def push_config(_): """Push core config to Hass.io.""" - await hassio.update_hass_timezone(str(hass.config.time_zone)) + nonlocal last_timezone + + new_timezone = str(hass.config.time_zone) + + if new_timezone == last_timezone: + return + + last_timezone = new_timezone + await hassio.update_hass_timezone(new_timezone) hass.bus.async_listen(EVENT_CORE_CONFIG_UPDATE, push_config) diff --git a/homeassistant/core.py b/homeassistant/core.py index eb7457daecb..2350c9a8102 100644 --- a/homeassistant/core.py +++ b/homeassistant/core.py @@ -261,11 +261,11 @@ class HomeAssistant: This method is a coroutine. """ _LOGGER.info("Starting Home Assistant") - self.state = CoreState.starting - setattr(self.loop, "_thread_ident", threading.get_ident()) - self.bus.async_fire(EVENT_HOMEASSISTANT_START) + + self.state = CoreState.starting self.bus.async_fire(EVENT_CORE_CONFIG_UPDATE) + self.bus.async_fire(EVENT_HOMEASSISTANT_START) try: # Only block for EVENT_HOMEASSISTANT_START listener @@ -291,8 +291,9 @@ class HomeAssistant: return self.state = CoreState.running - _async_create_timer(self) + self.bus.async_fire(EVENT_CORE_CONFIG_UPDATE) self.bus.async_fire(EVENT_HOMEASSISTANT_STARTED) + _async_create_timer(self) def add_job(self, target: Callable[..., Any], *args: Any) -> None: """Add job to the executor pool. diff --git a/tests/components/hassio/test_discovery.py b/tests/components/hassio/test_discovery.py index 9d148745f18..1cfb5ed9f7b 100644 --- a/tests/components/hassio/test_discovery.py +++ b/tests/components/hassio/test_discovery.py @@ -104,7 +104,7 @@ async def test_hassio_discovery_startup_done(hass, aioclient_mock, hassio_client await async_setup_component(hass, "hassio", {}) await hass.async_block_till_done() - assert aioclient_mock.call_count == 3 + assert aioclient_mock.call_count == 2 assert mock_mqtt.called mock_mqtt.assert_called_with( { diff --git a/tests/test_core.py b/tests/test_core.py index 9fc257eaf2d..c4079328f1f 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -22,12 +22,14 @@ from homeassistant.const import ( EVENT_HOMEASSISTANT_CLOSE, EVENT_HOMEASSISTANT_FINAL_WRITE, EVENT_HOMEASSISTANT_START, + EVENT_HOMEASSISTANT_STARTED, EVENT_HOMEASSISTANT_STOP, EVENT_SERVICE_REGISTERED, EVENT_SERVICE_REMOVED, EVENT_STATE_CHANGED, EVENT_TIME_CHANGED, EVENT_TIMER_OUT_OF_SYNC, + MATCH_ALL, __version__, ) import homeassistant.core as ha @@ -1333,3 +1335,35 @@ async def test_additional_data_in_core_config(hass, hass_storage): } await config.async_load() assert config.location_name == "Test Name" + + +async def test_start_events(hass): + """Test events fired when starting Home Assistant.""" + hass.state = ha.CoreState.not_running + + all_events = [] + + @ha.callback + def capture_events(ev): + all_events.append(ev.event_type) + + hass.bus.async_listen(MATCH_ALL, capture_events) + + core_states = [] + + @ha.callback + def capture_core_state(_): + core_states.append(hass.state) + + hass.bus.async_listen(EVENT_CORE_CONFIG_UPDATE, capture_core_state) + + await hass.async_start() + await hass.async_block_till_done() + + assert all_events == [ + EVENT_CORE_CONFIG_UPDATE, + EVENT_HOMEASSISTANT_START, + EVENT_CORE_CONFIG_UPDATE, + EVENT_HOMEASSISTANT_STARTED, + ] + assert core_states == [ha.CoreState.starting, ha.CoreState.running] From 61d6bd0cb58204bb1c18229db3016c1d3cb03f95 Mon Sep 17 00:00:00 2001 From: kennedyshead Date: Mon, 15 Jun 2020 14:14:48 +0200 Subject: [PATCH 7/9] Bump aioasuswrt to 1.2.6 (#36820) Co-authored-by: magnusknutas --- homeassistant/components/asuswrt/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/asuswrt/manifest.json b/homeassistant/components/asuswrt/manifest.json index 274060404b7..b7fe1054ffc 100644 --- a/homeassistant/components/asuswrt/manifest.json +++ b/homeassistant/components/asuswrt/manifest.json @@ -2,6 +2,6 @@ "domain": "asuswrt", "name": "ASUSWRT", "documentation": "https://www.home-assistant.io/integrations/asuswrt", - "requirements": ["aioasuswrt==1.2.5"], + "requirements": ["aioasuswrt==1.2.6"], "codeowners": ["@kennedyshead"] } diff --git a/requirements_all.txt b/requirements_all.txt index 8bcacf7330b..9c4ada0268e 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -156,7 +156,7 @@ aio_georss_gdacs==0.3 aioambient==1.1.1 # homeassistant.components.asuswrt -aioasuswrt==1.2.5 +aioasuswrt==1.2.6 # homeassistant.components.aws aiobotocore==0.11.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index f069566d7c0..7dd4eea8262 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -66,7 +66,7 @@ aio_georss_gdacs==0.3 aioambient==1.1.1 # homeassistant.components.asuswrt -aioasuswrt==1.2.5 +aioasuswrt==1.2.6 # homeassistant.components.aws aiobotocore==0.11.1 From 108082fd076620071ce846eeeb981cf314955424 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 15 Jun 2020 16:30:40 -0700 Subject: [PATCH 8/9] Fix cloudhooks coming in for non existing webhooks (#36836) * Fix cloudhooks coming in for non existing webhooks * Fix tests" --- homeassistant/components/cloud/client.py | 3 +- homeassistant/components/webhook/__init__.py | 11 ++++-- homeassistant/util/aiohttp.py | 24 +++++++++++++ .../ambiclimate/test_config_flow.py | 6 ++-- tests/components/cloud/test_client.py | 36 +++++++++++++++++-- tests/util/test_aiohttp.py | 6 ++-- 6 files changed, 76 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/cloud/client.py b/homeassistant/components/cloud/client.py index a17f536db72..5a70948555d 100644 --- a/homeassistant/components/cloud/client.py +++ b/homeassistant/components/cloud/client.py @@ -19,7 +19,7 @@ from homeassistant.helpers.typing import HomeAssistantType from homeassistant.util.aiohttp import MockRequest from . import alexa_config, google_config, utils -from .const import DISPATCHER_REMOTE_UPDATE +from .const import DISPATCHER_REMOTE_UPDATE, DOMAIN from .prefs import CloudPreferences _LOGGER = logging.getLogger(__name__) @@ -182,6 +182,7 @@ class CloudClient(Interface): headers=payload["headers"], method=payload["method"], query_string=payload["query"], + mock_source=DOMAIN, ) response = await self._hass.components.webhook.async_handle_webhook( diff --git a/homeassistant/components/webhook/__init__.py b/homeassistant/components/webhook/__init__.py index 47358d5008e..99226cabaa7 100644 --- a/homeassistant/components/webhook/__init__.py +++ b/homeassistant/components/webhook/__init__.py @@ -12,6 +12,7 @@ from homeassistant.const import HTTP_OK from homeassistant.core import callback from homeassistant.helpers.network import get_url from homeassistant.loader import bind_hass +from homeassistant.util.aiohttp import MockRequest _LOGGER = logging.getLogger(__name__) @@ -76,9 +77,15 @@ async def async_handle_webhook(hass, webhook_id, request): # Always respond successfully to not give away if a hook exists or not. if webhook is None: - peer_ip = request[KEY_REAL_IP] + if isinstance(request, MockRequest): + received_from = request.mock_source + else: + received_from = request[KEY_REAL_IP] + _LOGGER.warning( - "Received message for unregistered webhook %s from %s", webhook_id, peer_ip + "Received message for unregistered webhook %s from %s", + webhook_id, + received_from, ) # Look at content to provide some context for received webhook # Limit to 64 chars to avoid flooding the log diff --git a/homeassistant/util/aiohttp.py b/homeassistant/util/aiohttp.py index d43929dd777..36cdc0f25e2 100644 --- a/homeassistant/util/aiohttp.py +++ b/homeassistant/util/aiohttp.py @@ -1,4 +1,5 @@ """Utilities to help with aiohttp.""" +import io import json from typing import Any, Dict, Optional from urllib.parse import parse_qsl @@ -8,12 +9,29 @@ from multidict import CIMultiDict, MultiDict from homeassistant.const import HTTP_OK +class MockStreamReader: + """Small mock to imitate stream reader.""" + + def __init__(self, content: bytes) -> None: + """Initialize mock stream reader.""" + self._content = io.BytesIO(content) + + async def read(self, byte_count: int = -1) -> bytes: + """Read bytes.""" + if byte_count == -1: + return self._content.read() + return self._content.read(byte_count) + + class MockRequest: """Mock an aiohttp request.""" + mock_source: Optional[str] = None + def __init__( self, content: bytes, + mock_source: str, method: str = "GET", status: int = HTTP_OK, headers: Optional[Dict[str, str]] = None, @@ -27,6 +45,7 @@ class MockRequest: self.headers: CIMultiDict[str] = CIMultiDict(headers or {}) self.query_string = query_string or "" self._content = content + self.mock_source = mock_source @property def query(self) -> "MultiDict[str]": @@ -38,6 +57,11 @@ class MockRequest: """Return the body as text.""" return self._content.decode("utf-8") + @property + def content(self) -> MockStreamReader: + """Return the body as text.""" + return MockStreamReader(self._content) + async def json(self) -> Any: """Return the body as JSON.""" return json.loads(self._text) diff --git a/tests/components/ambiclimate/test_config_flow.py b/tests/components/ambiclimate/test_config_flow.py index 2ff7942f8dd..35c2ef69bb3 100644 --- a/tests/components/ambiclimate/test_config_flow.py +++ b/tests/components/ambiclimate/test_config_flow.py @@ -114,12 +114,14 @@ async def test_view(hass): """Test view.""" hass.config_entries.flow.async_init = AsyncMock() - request = aiohttp.MockRequest(b"", query_string="code=test_code") + request = aiohttp.MockRequest( + b"", query_string="code=test_code", mock_source="test" + ) request.app = {"hass": hass} view = config_flow.AmbiclimateAuthCallbackView() assert await view.get(request) == "OK!" - request = aiohttp.MockRequest(b"", query_string="") + request = aiohttp.MockRequest(b"", query_string="", mock_source="test") request.app = {"hass": hass} view = config_flow.AmbiclimateAuthCallbackView() assert await view.get(request) == "No code" diff --git a/tests/components/cloud/test_client.py b/tests/components/cloud/test_client.py index 21eb59ddc03..d0d9c4b25b7 100644 --- a/tests/components/cloud/test_client.py +++ b/tests/components/cloud/test_client.py @@ -141,7 +141,7 @@ async def test_handler_google_actions_disabled(hass, mock_cloud_fixture): assert resp["payload"]["errorCode"] == "deviceTurnedOff" -async def test_webhook_msg(hass): +async def test_webhook_msg(hass, caplog): """Test webhook msg.""" with patch("hass_nabucasa.Cloud.start"): setup = await async_setup_component(hass, "cloud", {"cloud": {}}) @@ -151,7 +151,14 @@ async def test_webhook_msg(hass): await cloud.client.prefs.async_initialize() await cloud.client.prefs.async_update( cloudhooks={ - "hello": {"webhook_id": "mock-webhook-id", "cloudhook_id": "mock-cloud-id"} + "mock-webhook-id": { + "webhook_id": "mock-webhook-id", + "cloudhook_id": "mock-cloud-id", + }, + "no-longere-existing": { + "webhook_id": "no-longere-existing", + "cloudhook_id": "mock-nonexisting-id", + }, } ) @@ -183,6 +190,31 @@ async def test_webhook_msg(hass): assert len(received) == 1 assert await received[0].json() == {"hello": "world"} + # Non existing webhook + caplog.clear() + + response = await cloud.client.async_webhook_message( + { + "cloudhook_id": "mock-nonexisting-id", + "body": '{"nonexisting": "payload"}', + "headers": {"content-type": "application/json"}, + "method": "POST", + "query": None, + } + ) + + assert response == { + "status": 200, + "body": None, + "headers": {"Content-Type": "application/octet-stream"}, + } + + assert ( + "Received message for unregistered webhook no-longere-existing from cloud" + in caplog.text + ) + assert '{"nonexisting": "payload"}' in caplog.text + async def test_google_config_expose_entity(hass, mock_cloud_setup, mock_cloud_login): """Test Google config exposing entity method uses latest config.""" diff --git a/tests/util/test_aiohttp.py b/tests/util/test_aiohttp.py index 870ed81c2e2..e7b5ef73c32 100644 --- a/tests/util/test_aiohttp.py +++ b/tests/util/test_aiohttp.py @@ -5,14 +5,14 @@ from homeassistant.util import aiohttp async def test_request_json(): """Test a JSON request.""" - request = aiohttp.MockRequest(b'{"hello": 2}') + request = aiohttp.MockRequest(b'{"hello": 2}', mock_source="test") assert request.status == 200 assert await request.json() == {"hello": 2} async def test_request_text(): """Test a JSON request.""" - request = aiohttp.MockRequest(b"hello", status=201) + request = aiohttp.MockRequest(b"hello", status=201, mock_source="test") assert request.status == 201 assert await request.text() == "hello" @@ -20,7 +20,7 @@ async def test_request_text(): async def test_request_post_query(): """Test a JSON request.""" request = aiohttp.MockRequest( - b"hello=2&post=true", query_string="get=true", method="POST" + b"hello=2&post=true", query_string="get=true", method="POST", mock_source="test" ) assert request.method == "POST" assert await request.post() == {"hello": "2", "post": "true"} From 0127974f09fbf3c5dd62069544ab35fd4e42dfba Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 15 Jun 2020 16:35:41 -0700 Subject: [PATCH 9/9] Bumped version to 0.111.3 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 5ad0c8f3808..093b39d6d1b 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -1,7 +1,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 111 -PATCH_VERSION = "2" +PATCH_VERSION = "3" __short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}" __version__ = f"{__short_version__}.{PATCH_VERSION}" REQUIRED_PYTHON_VER = (3, 7, 0)