Merge pull request #41498 from home-assistant/rc

This commit is contained in:
Paulus Schoutsen 2020-10-08 19:03:12 +02:00 committed by GitHub
commit b2885f6cc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 74 additions and 21 deletions

View File

@ -1,4 +1,5 @@
"""The devolo_home_control integration.""" """The devolo_home_control integration."""
import asyncio
from functools import partial from functools import partial
from devolo_home_control_api.homecontrol import HomeControl from devolo_home_control_api.homecontrol import HomeControl
@ -71,8 +72,13 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool
async def async_unload_entry(hass, config_entry): async def async_unload_entry(hass, config_entry):
"""Unload a config entry.""" """Unload a config entry."""
unload = await hass.config_entries.async_forward_entry_unload( unload = all(
config_entry, "switch" await asyncio.gather(
*[
hass.config_entries.async_forward_entry_unload(config_entry, platform)
for platform in PLATFORMS
]
)
) )
await hass.async_add_executor_job( await hass.async_add_executor_job(

View File

@ -2,7 +2,7 @@
"domain": "frontend", "domain": "frontend",
"name": "Home Assistant Frontend", "name": "Home Assistant Frontend",
"documentation": "https://www.home-assistant.io/integrations/frontend", "documentation": "https://www.home-assistant.io/integrations/frontend",
"requirements": ["home-assistant-frontend==20201001.1"], "requirements": ["home-assistant-frontend==20201001.2"],
"dependencies": [ "dependencies": [
"api", "api",
"auth", "auth",

View File

@ -2,6 +2,6 @@
"domain": "hive", "domain": "hive",
"name": "Hive", "name": "Hive",
"documentation": "https://www.home-assistant.io/integrations/hive", "documentation": "https://www.home-assistant.io/integrations/hive",
"requirements": ["pyhiveapi==0.2.20.1"], "requirements": ["pyhiveapi==0.2.20.2"],
"codeowners": ["@Rendili", "@KJonline"] "codeowners": ["@Rendili", "@KJonline"]
} }

View File

@ -2,16 +2,22 @@
from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.components.group import GroupIntegrationRegistry
from homeassistant.const import STATE_OFF from homeassistant.const import (
STATE_IDLE,
STATE_OFF,
STATE_ON,
STATE_PAUSED,
STATE_PLAYING,
)
from homeassistant.core import callback from homeassistant.core import callback
from homeassistant.helpers.typing import HomeAssistantType from homeassistant.helpers.typing import HomeAssistantType
from . import STATE_IDLE, STATE_PLAYING
@callback @callback
def async_describe_on_off_states( def async_describe_on_off_states(
hass: HomeAssistantType, registry: GroupIntegrationRegistry hass: HomeAssistantType, registry: GroupIntegrationRegistry
) -> None: ) -> None:
"""Describe group on off states.""" """Describe group on off states."""
registry.on_off_states({STATE_PLAYING, STATE_IDLE}, STATE_OFF) registry.on_off_states(
{STATE_ON, STATE_PAUSED, STATE_PLAYING, STATE_IDLE}, STATE_OFF
)

View File

@ -3,7 +3,7 @@
"name": "MQTT", "name": "MQTT",
"config_flow": true, "config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/mqtt", "documentation": "https://www.home-assistant.io/integrations/mqtt",
"requirements": ["paho-mqtt==1.5.1"], "requirements": ["paho-mqtt==1.5.0"],
"dependencies": ["http"], "dependencies": ["http"],
"codeowners": ["@home-assistant/core", "@emontnemery"] "codeowners": ["@home-assistant/core", "@emontnemery"]
} }

View File

@ -3,7 +3,7 @@
"name": "Netatmo", "name": "Netatmo",
"documentation": "https://www.home-assistant.io/integrations/netatmo", "documentation": "https://www.home-assistant.io/integrations/netatmo",
"requirements": [ "requirements": [
"pyatmo==4.0.0" "pyatmo==4.1.0"
], ],
"after_dependencies": [ "after_dependencies": [
"cloud", "cloud",

View File

@ -494,6 +494,7 @@ class Recorder(threading.Thread):
for dbstate in self._pending_expunge: for dbstate in self._pending_expunge:
# Expunge the state so its not expired # Expunge the state so its not expired
# until we use it later for dbstate.old_state # until we use it later for dbstate.old_state
if dbstate in self.event_session:
self.event_session.expunge(dbstate) self.event_session.expunge(dbstate)
self._pending_expunge = [] self._pending_expunge = []
self.event_session.commit() self.event_session.commit()

View File

@ -1,7 +1,7 @@
"""Constants used by Home Assistant components.""" """Constants used by Home Assistant components."""
MAJOR_VERSION = 0 MAJOR_VERSION = 0
MINOR_VERSION = 116 MINOR_VERSION = 116
PATCH_VERSION = "0" PATCH_VERSION = "1"
__short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}" __short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__ = f"{__short_version__}.{PATCH_VERSION}" __version__ = f"{__short_version__}.{PATCH_VERSION}"
REQUIRED_PYTHON_VER = (3, 7, 1) REQUIRED_PYTHON_VER = (3, 7, 1)

View File

@ -13,11 +13,11 @@ defusedxml==0.6.0
distro==1.5.0 distro==1.5.0
emoji==0.5.4 emoji==0.5.4
hass-nabucasa==0.37.0 hass-nabucasa==0.37.0
home-assistant-frontend==20201001.1 home-assistant-frontend==20201001.2
importlib-metadata==1.6.0;python_version<'3.8' importlib-metadata==1.6.0;python_version<'3.8'
jinja2>=2.11.2 jinja2>=2.11.2
netdisco==2.8.2 netdisco==2.8.2
paho-mqtt==1.5.1 paho-mqtt==1.5.0
pillow==7.2.0 pillow==7.2.0
pip>=8.0.3 pip>=8.0.3
python-slugify==4.0.1 python-slugify==4.0.1

View File

@ -753,7 +753,7 @@ hole==0.5.1
holidays==0.10.3 holidays==0.10.3
# homeassistant.components.frontend # homeassistant.components.frontend
home-assistant-frontend==20201001.1 home-assistant-frontend==20201001.2
# homeassistant.components.zwave # homeassistant.components.zwave
homeassistant-pyozw==0.1.10 homeassistant-pyozw==0.1.10
@ -1058,6 +1058,8 @@ orvibo==1.1.1
ovoenergy==1.1.7 ovoenergy==1.1.7
# homeassistant.components.mqtt # homeassistant.components.mqtt
paho-mqtt==1.5.0
# homeassistant.components.shiftr # homeassistant.components.shiftr
paho-mqtt==1.5.1 paho-mqtt==1.5.1
@ -1250,7 +1252,7 @@ pyarlo==0.2.3
pyatag==0.3.4.4 pyatag==0.3.4.4
# homeassistant.components.netatmo # homeassistant.components.netatmo
pyatmo==4.0.0 pyatmo==4.1.0
# homeassistant.components.atome # homeassistant.components.atome
pyatome==0.1.1 pyatome==0.1.1
@ -1401,7 +1403,7 @@ pyheos==0.6.0
pyhik==0.2.7 pyhik==0.2.7
# homeassistant.components.hive # homeassistant.components.hive
pyhiveapi==0.2.20.1 pyhiveapi==0.2.20.2
# homeassistant.components.homematic # homeassistant.components.homematic
pyhomematic==0.1.68 pyhomematic==0.1.68

View File

@ -376,7 +376,7 @@ hole==0.5.1
holidays==0.10.3 holidays==0.10.3
# homeassistant.components.frontend # homeassistant.components.frontend
home-assistant-frontend==20201001.1 home-assistant-frontend==20201001.2
# homeassistant.components.zwave # homeassistant.components.zwave
homeassistant-pyozw==0.1.10 homeassistant-pyozw==0.1.10
@ -499,8 +499,7 @@ openerz-api==0.1.0
ovoenergy==1.1.7 ovoenergy==1.1.7
# homeassistant.components.mqtt # homeassistant.components.mqtt
# homeassistant.components.shiftr paho-mqtt==1.5.0
paho-mqtt==1.5.1
# homeassistant.components.panasonic_viera # homeassistant.components.panasonic_viera
panasonic_viera==0.3.6 panasonic_viera==0.3.6
@ -616,7 +615,7 @@ pyarlo==0.2.3
pyatag==0.3.4.4 pyatag==0.3.4.4
# homeassistant.components.netatmo # homeassistant.components.netatmo
pyatmo==4.0.0 pyatmo==4.1.0
# homeassistant.components.blackbird # homeassistant.components.blackbird
pyblackbird==0.5 pyblackbird==0.5

View File

@ -4,6 +4,7 @@ from datetime import datetime, timedelta
import unittest import unittest
import pytest import pytest
from sqlalchemy.exc import OperationalError
from homeassistant.components.recorder import ( from homeassistant.components.recorder import (
CONFIG_SCHEMA, CONFIG_SCHEMA,
@ -452,3 +453,41 @@ def test_run_information(hass_recorder):
class CannotSerializeMe: class CannotSerializeMe:
"""A class that the JSONEncoder cannot serialize.""" """A class that the JSONEncoder cannot serialize."""
def test_saving_state_with_exception(hass, hass_recorder, caplog):
"""Test saving and restoring a state."""
hass = hass_recorder()
entity_id = "test.recorder"
state = "restoring_from_db"
attributes = {"test_attr": 5, "test_attr_10": "nice"}
def _throw_if_state_in_session(*args, **kwargs):
for obj in hass.data[DATA_INSTANCE].event_session:
if isinstance(obj, States):
raise OperationalError(
"insert the state", "fake params", "forced to fail"
)
with patch("time.sleep"), patch.object(
hass.data[DATA_INSTANCE].event_session,
"flush",
side_effect=_throw_if_state_in_session,
):
hass.states.set(entity_id, "fail", attributes)
wait_recording_done(hass)
assert "Error executing query" in caplog.text
assert "Error saving events" not in caplog.text
caplog.clear()
hass.states.set(entity_id, state, attributes)
wait_recording_done(hass)
with session_scope(hass=hass) as session:
db_states = list(session.query(States))
assert len(db_states) >= 1
assert "Error executing query" not in caplog.text
assert "Error saving events" not in caplog.text