From 0959777b8166690088dc8abe438fbbb63e630fcb Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Thu, 29 Oct 2020 09:22:36 +0100 Subject: [PATCH 01/10] Fix adding Virtual DSM system in synology_dsm (#42523) --- .../components/synology_dsm/config_flow.py | 1 - .../synology_dsm/test_config_flow.py | 48 +++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/synology_dsm/config_flow.py b/homeassistant/components/synology_dsm/config_flow.py index 2267d0b099c37..314bab5480617 100644 --- a/homeassistant/components/synology_dsm/config_flow.py +++ b/homeassistant/components/synology_dsm/config_flow.py @@ -275,7 +275,6 @@ def _login_and_fetch_syno_info(api, otp_code): if ( not api.information.serial or api.utilisation.cpu_user_load is None - or not api.storage.disks_ids or not api.storage.volumes_ids or not api.network.macs ): diff --git a/tests/components/synology_dsm/test_config_flow.py b/tests/components/synology_dsm/test_config_flow.py index 5a1a86ef67305..fd060ce352936 100644 --- a/tests/components/synology_dsm/test_config_flow.py +++ b/tests/components/synology_dsm/test_config_flow.py @@ -81,6 +81,20 @@ def mock_controller_service_2sa(): yield service_mock +@pytest.fixture(name="service_vdsm") +def mock_controller_service_vdsm(): + """Mock a successful service.""" + with patch( + "homeassistant.components.synology_dsm.config_flow.SynologyDSM" + ) as service_mock: + service_mock.return_value.information.serial = SERIAL + service_mock.return_value.utilisation.cpu_user_load = 1 + service_mock.return_value.storage.disks_ids = [] + service_mock.return_value.storage.volumes_ids = ["volume_1"] + service_mock.return_value.network.macs = MACS + yield service_mock + + @pytest.fixture(name="service_failed") def mock_controller_service_failed(): """Mock a failed service.""" @@ -196,6 +210,40 @@ async def test_user_2sa(hass: HomeAssistantType, service_2sa: MagicMock): assert result["data"].get(CONF_VOLUMES) is None +async def test_user_vdsm(hass: HomeAssistantType, service_vdsm: MagicMock): + """Test user config.""" + result = await hass.config_entries.flow.async_init( + DOMAIN, context={"source": SOURCE_USER}, data=None + ) + assert result["type"] == data_entry_flow.RESULT_TYPE_FORM + assert result["step_id"] == "user" + + # test with all provided + result = await hass.config_entries.flow.async_init( + DOMAIN, + context={"source": SOURCE_USER}, + data={ + CONF_HOST: HOST, + CONF_PORT: PORT, + CONF_SSL: SSL, + CONF_USERNAME: USERNAME, + CONF_PASSWORD: PASSWORD, + }, + ) + assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY + assert result["result"].unique_id == SERIAL + assert result["title"] == HOST + assert result["data"][CONF_HOST] == HOST + assert result["data"][CONF_PORT] == PORT + assert result["data"][CONF_SSL] == SSL + assert result["data"][CONF_USERNAME] == USERNAME + assert result["data"][CONF_PASSWORD] == PASSWORD + assert result["data"][CONF_MAC] == MACS + assert result["data"].get("device_token") is None + assert result["data"].get(CONF_DISKS) is None + assert result["data"].get(CONF_VOLUMES) is None + + async def test_import(hass: HomeAssistantType, service: MagicMock): """Test import step.""" # import with minimum setup From 048db9cb7da8a579551a380669f8c07dd5fd858a Mon Sep 17 00:00:00 2001 From: Rob Bierbooms Date: Fri, 30 Oct 2020 09:11:25 +0100 Subject: [PATCH 02/10] Enable polling for DSMR derivative entity (#42524) --- homeassistant/components/dsmr/sensor.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/homeassistant/components/dsmr/sensor.py b/homeassistant/components/dsmr/sensor.py index 411088c5091e3..7b9f9bab6f1c0 100644 --- a/homeassistant/components/dsmr/sensor.py +++ b/homeassistant/components/dsmr/sensor.py @@ -320,6 +320,16 @@ def state(self): """Return the calculated current hourly rate.""" return self._state + @property + def force_update(self): + """Disable force update.""" + return False + + @property + def should_poll(self): + """Enable polling.""" + return True + async def async_update(self): """Recalculate hourly rate if timestamp has changed. From 1ab2d55a7ab7ea5d60170ea2e297cc18c0a4c3f1 Mon Sep 17 00:00:00 2001 From: Jc2k Date: Wed, 28 Oct 2020 23:06:01 +0000 Subject: [PATCH 03/10] Bump aiohomekit to 0.2.54 (#42532) --- homeassistant/components/homekit_controller/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/homekit_controller/manifest.json b/homeassistant/components/homekit_controller/manifest.json index 1fb4c05c595d8..efe842bad0f23 100644 --- a/homeassistant/components/homekit_controller/manifest.json +++ b/homeassistant/components/homekit_controller/manifest.json @@ -4,7 +4,7 @@ "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/homekit_controller", "requirements": [ - "aiohomekit==0.2.53" + "aiohomekit==0.2.54" ], "zeroconf": [ "_hap._tcp.local." diff --git a/requirements_all.txt b/requirements_all.txt index cab265931918b..aa7b58fbd8020 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -178,7 +178,7 @@ aioguardian==1.0.1 aioharmony==0.2.6 # homeassistant.components.homekit_controller -aiohomekit==0.2.53 +aiohomekit==0.2.54 # homeassistant.components.emulated_hue # homeassistant.components.http diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 5d3df986871ec..e6831b84225e6 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -109,7 +109,7 @@ aioguardian==1.0.1 aioharmony==0.2.6 # homeassistant.components.homekit_controller -aiohomekit==0.2.53 +aiohomekit==0.2.54 # homeassistant.components.emulated_hue # homeassistant.components.http From c604595f987106a8448637370f6f1f9527280a02 Mon Sep 17 00:00:00 2001 From: cgtobi Date: Thu, 29 Oct 2020 11:50:39 +0100 Subject: [PATCH 04/10] Fix RMV giving wrong data and ignoring given parameters (#42561) --- homeassistant/components/rmvtransport/sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/rmvtransport/sensor.py b/homeassistant/components/rmvtransport/sensor.py index 76e75d77a58f6..4a619437d52bf 100644 --- a/homeassistant/components/rmvtransport/sensor.py +++ b/homeassistant/components/rmvtransport/sensor.py @@ -263,10 +263,10 @@ async def async_update(self): if not dest_found: continue - elif self._lines and journey["number"] not in self._lines: + if self._lines and journey["number"] not in self._lines: continue - elif journey["minutes"] < self._time_offset: + if journey["minutes"] < self._time_offset: continue for attr in ["direction", "departure_time", "product", "minutes"]: From c57d697df530d2df3c04d11ca99af2d8fc8f0909 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 30 Oct 2020 00:14:07 +0100 Subject: [PATCH 05/10] Update frontend to 20201021.4 (#42590) --- homeassistant/components/frontend/manifest.json | 2 +- homeassistant/package_constraints.txt | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/frontend/manifest.json b/homeassistant/components/frontend/manifest.json index ee27bb08d748b..0957c6fd7765c 100644 --- a/homeassistant/components/frontend/manifest.json +++ b/homeassistant/components/frontend/manifest.json @@ -2,7 +2,7 @@ "domain": "frontend", "name": "Home Assistant Frontend", "documentation": "https://www.home-assistant.io/integrations/frontend", - "requirements": ["home-assistant-frontend==20201021.3"], + "requirements": ["home-assistant-frontend==20201021.4"], "dependencies": [ "api", "auth", diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 10cb7858aba5c..203bbb62027f8 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -13,7 +13,7 @@ defusedxml==0.6.0 distro==1.5.0 emoji==0.5.4 hass-nabucasa==0.37.1 -home-assistant-frontend==20201021.3 +home-assistant-frontend==20201021.4 httpx==0.16.1 importlib-metadata==1.6.0;python_version<'3.8' jinja2>=2.11.2 diff --git a/requirements_all.txt b/requirements_all.txt index aa7b58fbd8020..0a0f919eaf558 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -759,7 +759,7 @@ hole==0.5.1 holidays==0.10.3 # homeassistant.components.frontend -home-assistant-frontend==20201021.3 +home-assistant-frontend==20201021.4 # homeassistant.components.zwave homeassistant-pyozw==0.1.10 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index e6831b84225e6..1dd47f41cb6f5 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -385,7 +385,7 @@ hole==0.5.1 holidays==0.10.3 # homeassistant.components.frontend -home-assistant-frontend==20201021.3 +home-assistant-frontend==20201021.4 # homeassistant.components.zwave homeassistant-pyozw==0.1.10 From aa52ade5a06d52e895b34d76a279170b6a660a8c Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 29 Oct 2020 20:09:41 +0100 Subject: [PATCH 06/10] Fix MQTT template light (#42598) --- homeassistant/components/mqtt/light/schema_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/mqtt/light/schema_template.py b/homeassistant/components/mqtt/light/schema_template.py index 44a87f2af2c84..faf987881b988 100644 --- a/homeassistant/components/mqtt/light/schema_template.py +++ b/homeassistant/components/mqtt/light/schema_template.py @@ -252,7 +252,7 @@ def state_received(msg): except ValueError: _LOGGER.warning("Invalid color value received") - if self._templates[CONF_COLOR_TEMP_TEMPLATE] is not None: + if self._templates[CONF_WHITE_VALUE_TEMPLATE] is not None: try: self._white_value = int( self._templates[ From d26bceb110bf9bbf656826aeaaee6c10cdab4a2a Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Fri, 30 Oct 2020 00:13:49 +0100 Subject: [PATCH 07/10] Bump hatasmota to 0.0.25 (#42605) --- .../components/tasmota/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/tasmota/test_sensor.py | 91 +++++++++++-------- 4 files changed, 56 insertions(+), 41 deletions(-) diff --git a/homeassistant/components/tasmota/manifest.json b/homeassistant/components/tasmota/manifest.json index 991e38e6a95bf..b087e13ece0cf 100644 --- a/homeassistant/components/tasmota/manifest.json +++ b/homeassistant/components/tasmota/manifest.json @@ -3,7 +3,7 @@ "name": "Tasmota (beta)", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/tasmota", - "requirements": ["hatasmota==0.0.24"], + "requirements": ["hatasmota==0.0.25"], "dependencies": ["mqtt"], "mqtt": ["tasmota/discovery/#"], "codeowners": ["@emontnemery"] diff --git a/requirements_all.txt b/requirements_all.txt index 0a0f919eaf558..0c8f9b4fed9e6 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -732,7 +732,7 @@ hass-nabucasa==0.37.1 hass_splunk==0.1.1 # homeassistant.components.tasmota -hatasmota==0.0.24 +hatasmota==0.0.25 # homeassistant.components.jewish_calendar hdate==0.9.12 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 1dd47f41cb6f5..c92af14b834e0 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -367,7 +367,7 @@ hangups==0.4.11 hass-nabucasa==0.37.1 # homeassistant.components.tasmota -hatasmota==0.0.24 +hatasmota==0.0.25 # homeassistant.components.jewish_calendar hdate==0.9.12 diff --git a/tests/components/tasmota/test_sensor.py b/tests/components/tasmota/test_sensor.py index ab8498ed04cfe..e5d55b75a3ade 100644 --- a/tests/components/tasmota/test_sensor.py +++ b/tests/components/tasmota/test_sensor.py @@ -105,12 +105,12 @@ async def test_controlling_state_via_mqtt(hass, mqtt_mock, setup_tasmota): ) await hass.async_block_till_done() - state = hass.states.get("sensor.dht11_temperature") + state = hass.states.get("sensor.tasmota_dht11_temperature") assert state.state == "unavailable" assert not state.attributes.get(ATTR_ASSUMED_STATE) async_fire_mqtt_message(hass, "tasmota_49A3BC/tele/LWT", "Online") - state = hass.states.get("sensor.dht11_temperature") + state = hass.states.get("sensor.tasmota_dht11_temperature") assert state.state == STATE_UNKNOWN assert not state.attributes.get(ATTR_ASSUMED_STATE) @@ -118,7 +118,7 @@ async def test_controlling_state_via_mqtt(hass, mqtt_mock, setup_tasmota): async_fire_mqtt_message( hass, "tasmota_49A3BC/tele/SENSOR", '{"DHT11":{"Temperature":20.5}}' ) - state = hass.states.get("sensor.dht11_temperature") + state = hass.states.get("sensor.tasmota_dht11_temperature") assert state.state == "20.5" # Test polled state update @@ -127,7 +127,7 @@ async def test_controlling_state_via_mqtt(hass, mqtt_mock, setup_tasmota): "tasmota_49A3BC/stat/STATUS8", '{"StatusSNS":{"DHT11":{"Temperature":20.0}}}', ) - state = hass.states.get("sensor.dht11_temperature") + state = hass.states.get("sensor.tasmota_dht11_temperature") assert state.state == "20.0" @@ -150,12 +150,12 @@ async def test_nested_sensor_state_via_mqtt(hass, mqtt_mock, setup_tasmota): ) await hass.async_block_till_done() - state = hass.states.get("sensor.tx23_speed_act") + state = hass.states.get("sensor.tasmota_tx23_speed_act") assert state.state == "unavailable" assert not state.attributes.get(ATTR_ASSUMED_STATE) async_fire_mqtt_message(hass, "tasmota_49A3BC/tele/LWT", "Online") - state = hass.states.get("sensor.tx23_speed_act") + state = hass.states.get("sensor.tasmota_tx23_speed_act") assert state.state == STATE_UNKNOWN assert not state.attributes.get(ATTR_ASSUMED_STATE) @@ -163,7 +163,7 @@ async def test_nested_sensor_state_via_mqtt(hass, mqtt_mock, setup_tasmota): async_fire_mqtt_message( hass, "tasmota_49A3BC/tele/SENSOR", '{"TX23":{"Speed":{"Act":"12.3"}}}' ) - state = hass.states.get("sensor.tx23_speed_act") + state = hass.states.get("sensor.tasmota_tx23_speed_act") assert state.state == "12.3" # Test polled state update @@ -172,7 +172,7 @@ async def test_nested_sensor_state_via_mqtt(hass, mqtt_mock, setup_tasmota): "tasmota_49A3BC/stat/STATUS8", '{"StatusSNS":{"TX23":{"Speed":{"Act":"23.4"}}}}', ) - state = hass.states.get("sensor.tx23_speed_act") + state = hass.states.get("sensor.tasmota_tx23_speed_act") assert state.state == "23.4" @@ -195,12 +195,12 @@ async def test_indexed_sensor_state_via_mqtt(hass, mqtt_mock, setup_tasmota): ) await hass.async_block_till_done() - state = hass.states.get("sensor.energy_totaltariff_1") + state = hass.states.get("sensor.tasmota_energy_totaltariff_1") assert state.state == "unavailable" assert not state.attributes.get(ATTR_ASSUMED_STATE) async_fire_mqtt_message(hass, "tasmota_49A3BC/tele/LWT", "Online") - state = hass.states.get("sensor.energy_totaltariff_1") + state = hass.states.get("sensor.tasmota_energy_totaltariff_1") assert state.state == STATE_UNKNOWN assert not state.attributes.get(ATTR_ASSUMED_STATE) @@ -208,7 +208,7 @@ async def test_indexed_sensor_state_via_mqtt(hass, mqtt_mock, setup_tasmota): async_fire_mqtt_message( hass, "tasmota_49A3BC/tele/SENSOR", '{"ENERGY":{"TotalTariff":[1.2,3.4]}}' ) - state = hass.states.get("sensor.energy_totaltariff_1") + state = hass.states.get("sensor.tasmota_energy_totaltariff_1") assert state.state == "3.4" # Test polled state update @@ -217,7 +217,7 @@ async def test_indexed_sensor_state_via_mqtt(hass, mqtt_mock, setup_tasmota): "tasmota_49A3BC/stat/STATUS8", '{"StatusSNS":{"ENERGY":{"TotalTariff":[5.6,7.8]}}}', ) - state = hass.states.get("sensor.energy_totaltariff_1") + state = hass.states.get("sensor.tasmota_energy_totaltariff_1") assert state.state == "7.8" @@ -297,15 +297,15 @@ async def test_attributes(hass, mqtt_mock, setup_tasmota): ) await hass.async_block_till_done() - state = hass.states.get("sensor.dht11_temperature") + state = hass.states.get("sensor.tasmota_dht11_temperature") assert state.attributes.get("device_class") == "temperature" - assert state.attributes.get("friendly_name") == "DHT11 Temperature" + assert state.attributes.get("friendly_name") == "Tasmota DHT11 Temperature" assert state.attributes.get("icon") is None assert state.attributes.get("unit_of_measurement") == "C" - state = hass.states.get("sensor.beer_CarbonDioxide") + state = hass.states.get("sensor.tasmota_beer_CarbonDioxide") assert state.attributes.get("device_class") is None - assert state.attributes.get("friendly_name") == "Beer CarbonDioxide" + assert state.attributes.get("friendly_name") == "Tasmota Beer CarbonDioxide" assert state.attributes.get("icon") == "mdi:molecule-co2" assert state.attributes.get("unit_of_measurement") == "ppm" @@ -329,15 +329,15 @@ async def test_nested_sensor_attributes(hass, mqtt_mock, setup_tasmota): ) await hass.async_block_till_done() - state = hass.states.get("sensor.tx23_speed_act") + state = hass.states.get("sensor.tasmota_tx23_speed_act") assert state.attributes.get("device_class") is None - assert state.attributes.get("friendly_name") == "TX23 Speed Act" + assert state.attributes.get("friendly_name") == "Tasmota TX23 Speed Act" assert state.attributes.get("icon") is None assert state.attributes.get("unit_of_measurement") == "km/h" - state = hass.states.get("sensor.tx23_dir_avg") + state = hass.states.get("sensor.tasmota_tx23_dir_avg") assert state.attributes.get("device_class") is None - assert state.attributes.get("friendly_name") == "TX23 Dir Avg" + assert state.attributes.get("friendly_name") == "Tasmota TX23 Dir Avg" assert state.attributes.get("icon") is None assert state.attributes.get("unit_of_measurement") == " " @@ -367,15 +367,15 @@ async def test_indexed_sensor_attributes(hass, mqtt_mock, setup_tasmota): ) await hass.async_block_till_done() - state = hass.states.get("sensor.dummy1_temperature_0") + state = hass.states.get("sensor.tasmota_dummy1_temperature_0") assert state.attributes.get("device_class") == "temperature" - assert state.attributes.get("friendly_name") == "Dummy1 Temperature 0" + assert state.attributes.get("friendly_name") == "Tasmota Dummy1 Temperature 0" assert state.attributes.get("icon") is None assert state.attributes.get("unit_of_measurement") == "C" - state = hass.states.get("sensor.dummy2_carbondioxide_1") + state = hass.states.get("sensor.tasmota_dummy2_carbondioxide_1") assert state.attributes.get("device_class") is None - assert state.attributes.get("friendly_name") == "Dummy2 CarbonDioxide 1" + assert state.attributes.get("friendly_name") == "Tasmota Dummy2 CarbonDioxide 1" assert state.attributes.get("icon") == "mdi:molecule-co2" assert state.attributes.get("unit_of_measurement") == "ppm" @@ -396,15 +396,15 @@ async def test_enable_status_sensor(hass, mqtt_mock, setup_tasmota): await hass.async_block_till_done() await hass.async_block_till_done() - state = hass.states.get("sensor.tasmota_status") + state = hass.states.get("sensor.tasmota_signal") assert state is None - entry = entity_reg.async_get("sensor.tasmota_status") + entry = entity_reg.async_get("sensor.tasmota_signal") assert entry.disabled assert entry.disabled_by == "integration" # Enable the status sensor updated_entry = entity_reg.async_update_entity( - "sensor.tasmota_status", disabled_by=None + "sensor.tasmota_signal", disabled_by=None ) assert updated_entry != entry assert updated_entry.disabled is False @@ -428,12 +428,12 @@ async def test_enable_status_sensor(hass, mqtt_mock, setup_tasmota): ) await hass.async_block_till_done() - state = hass.states.get("sensor.tasmota_status") + state = hass.states.get("sensor.tasmota_signal") assert state.state == "unavailable" assert not state.attributes.get(ATTR_ASSUMED_STATE) async_fire_mqtt_message(hass, "tasmota_49A3BC/tele/LWT", "Online") - state = hass.states.get("sensor.tasmota_status") + state = hass.states.get("sensor.tasmota_signal") assert state.state == STATE_UNKNOWN assert not state.attributes.get(ATTR_ASSUMED_STATE) @@ -451,7 +451,7 @@ async def test_availability_when_connection_lost( sensor.DOMAIN, config, sensor_config, - "dht11_temperature", + "tasmota_dht11_temperature", ) @@ -460,7 +460,12 @@ async def test_availability(hass, mqtt_mock, setup_tasmota): config = copy.deepcopy(DEFAULT_CONFIG) sensor_config = copy.deepcopy(DEFAULT_SENSOR_CONFIG) await help_test_availability( - hass, mqtt_mock, sensor.DOMAIN, config, sensor_config, "dht11_temperature" + hass, + mqtt_mock, + sensor.DOMAIN, + config, + sensor_config, + "tasmota_dht11_temperature", ) @@ -469,7 +474,12 @@ async def test_availability_discovery_update(hass, mqtt_mock, setup_tasmota): config = copy.deepcopy(DEFAULT_CONFIG) sensor_config = copy.deepcopy(DEFAULT_SENSOR_CONFIG) await help_test_availability_discovery_update( - hass, mqtt_mock, sensor.DOMAIN, config, sensor_config, "dht11_temperature" + hass, + mqtt_mock, + sensor.DOMAIN, + config, + sensor_config, + "tasmota_dht11_temperature", ) @@ -506,8 +516,8 @@ async def test_discovery_removal_sensor(hass, mqtt_mock, caplog, setup_tasmota): config, sensor_config1, {}, - "dht11_temperature", - "DHT11 Temperature", + "tasmota_dht11_temperature", + "Tasmota DHT11 Temperature", ) @@ -528,8 +538,8 @@ async def test_discovery_update_unchanged_sensor( config, discovery_update, sensor_config, - "dht11_temperature", - "DHT11 Temperature", + "tasmota_dht11_temperature", + "Tasmota DHT11 Temperature", ) @@ -559,7 +569,7 @@ async def test_entity_id_update_subscriptions(hass, mqtt_mock, setup_tasmota): config, topics, sensor_config, - "dht11_temperature", + "tasmota_dht11_temperature", ) @@ -568,5 +578,10 @@ async def test_entity_id_update_discovery_update(hass, mqtt_mock, setup_tasmota) config = copy.deepcopy(DEFAULT_CONFIG) sensor_config = copy.deepcopy(DEFAULT_SENSOR_CONFIG) await help_test_entity_id_update_discovery_update( - hass, mqtt_mock, sensor.DOMAIN, config, sensor_config, "dht11_temperature" + hass, + mqtt_mock, + sensor.DOMAIN, + config, + sensor_config, + "tasmota_dht11_temperature", ) From 26766d68aaf7cc6293a65b0aa6ccaff185a55652 Mon Sep 17 00:00:00 2001 From: Clifford Roche Date: Thu, 29 Oct 2020 19:49:13 -0400 Subject: [PATCH 08/10] Update greeclimate to 0.9.2 (#42616) Fixes issue with erroneous await in UDP recv queue --- homeassistant/components/gree/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/gree/manifest.json b/homeassistant/components/gree/manifest.json index ea04eb12f5140..c5fb412f1d153 100644 --- a/homeassistant/components/gree/manifest.json +++ b/homeassistant/components/gree/manifest.json @@ -3,6 +3,6 @@ "name": "Gree Climate", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/gree", - "requirements": ["greeclimate==0.9.0"], + "requirements": ["greeclimate==0.9.2"], "codeowners": ["@cmroche"] } diff --git a/requirements_all.txt b/requirements_all.txt index 0c8f9b4fed9e6..8d0a2be17d5c0 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -696,7 +696,7 @@ gpiozero==1.5.1 gps3==0.33.3 # homeassistant.components.gree -greeclimate==0.9.0 +greeclimate==0.9.2 # homeassistant.components.greeneye_monitor greeneye_monitor==2.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index c92af14b834e0..f3e61a25d4de3 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -352,7 +352,7 @@ google-cloud-pubsub==0.39.1 google-nest-sdm==0.1.6 # homeassistant.components.gree -greeclimate==0.9.0 +greeclimate==0.9.2 # homeassistant.components.griddy griddypower==0.1.0 From 2dcd57bf38789bda3ced4509d718c21b8f1fd128 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 30 Oct 2020 08:31:58 +0000 Subject: [PATCH 09/10] Bumped version to 0.117.1 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index fdf4b26567cd0..95ce48ca88f13 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -1,7 +1,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 117 -PATCH_VERSION = "0" +PATCH_VERSION = "1" __short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}" __version__ = f"{__short_version__}.{PATCH_VERSION}" REQUIRED_PYTHON_VER = (3, 7, 1) From 750bb11895bde00f14c9506be5944a69b4e7b555 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 29 Oct 2020 22:34:06 +0100 Subject: [PATCH 10/10] Fix broken time trigger test (#42606) --- tests/components/config/test_core.py | 35 ++++++++++--------- tests/components/hassio/test_init.py | 3 +- .../homeassistant/triggers/test_time.py | 1 - 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/tests/components/config/test_core.py b/tests/components/config/test_core.py index 1f379727b442c..72e655dbb66d7 100644 --- a/tests/components/config/test_core.py +++ b/tests/components/config/test_core.py @@ -61,22 +61,23 @@ async def test_websocket_core_update(hass, client): assert hass.config.external_url != "https://www.example.com" assert hass.config.internal_url != "http://example.com" - await client.send_json( - { - "id": 5, - "type": "config/core/update", - "latitude": 60, - "longitude": 50, - "elevation": 25, - "location_name": "Huis", - CONF_UNIT_SYSTEM: CONF_UNIT_SYSTEM_IMPERIAL, - "time_zone": "America/New_York", - "external_url": "https://www.example.com", - "internal_url": "http://example.local", - } - ) + with patch("homeassistant.util.dt.set_default_time_zone") as mock_set_tz: + await client.send_json( + { + "id": 5, + "type": "config/core/update", + "latitude": 60, + "longitude": 50, + "elevation": 25, + "location_name": "Huis", + CONF_UNIT_SYSTEM: CONF_UNIT_SYSTEM_IMPERIAL, + "time_zone": "America/New_York", + "external_url": "https://www.example.com", + "internal_url": "http://example.local", + } + ) - msg = await client.receive_json() + msg = await client.receive_json() assert msg["id"] == 5 assert msg["type"] == TYPE_RESULT @@ -86,11 +87,11 @@ async def test_websocket_core_update(hass, client): assert hass.config.elevation == 25 assert hass.config.location_name == "Huis" assert hass.config.units.name == CONF_UNIT_SYSTEM_IMPERIAL - assert hass.config.time_zone.zone == "America/New_York" assert hass.config.external_url == "https://www.example.com" assert hass.config.internal_url == "http://example.local" - dt_util.set_default_time_zone(ORIG_TIME_ZONE) + assert len(mock_set_tz.mock_calls) == 1 + assert mock_set_tz.mock_calls[0][1][0].zone == "America/New_York" async def test_websocket_core_update_not_admin(hass, hass_ws_client, hass_admin_user): diff --git a/tests/components/hassio/test_init.py b/tests/components/hassio/test_init.py index 56792295fec3e..62b4a4adbd267 100644 --- a/tests/components/hassio/test_init.py +++ b/tests/components/hassio/test_init.py @@ -186,7 +186,8 @@ async def test_setup_core_push_timezone(hass, aioclient_mock): assert aioclient_mock.call_count == 7 assert aioclient_mock.mock_calls[2][2]["timezone"] == "testzone" - await hass.config.async_update(time_zone="America/New_York") + with patch("homeassistant.util.dt.set_default_time_zone"): + await hass.config.async_update(time_zone="America/New_York") await hass.async_block_till_done() assert aioclient_mock.mock_calls[-1][2]["timezone"] == "America/New_York" diff --git a/tests/components/homeassistant/triggers/test_time.py b/tests/components/homeassistant/triggers/test_time.py index db10e8366291b..91fd57beed320 100644 --- a/tests/components/homeassistant/triggers/test_time.py +++ b/tests/components/homeassistant/triggers/test_time.py @@ -74,7 +74,6 @@ async def test_if_fires_using_at_input_datetime(hass, calls, has_date, has_time) "input_datetime", {"input_datetime": {"trigger": {"has_date": has_date, "has_time": has_time}}}, ) - now = dt_util.now() trigger_dt = now.replace(