Skip to content

Commit eb718bf

Browse files
authored
Merge pull request #33862 from home-assistant/rc
0.108.1
2 parents 3815837 + 70f1460 commit eb718bf

File tree

17 files changed

+338
-150
lines changed

17 files changed

+338
-150
lines changed

homeassistant/components/doorbird/config_flow.py

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,8 @@ async def async_step_user(self, user_input=None):
6868
"""Handle the initial step."""
6969
errors = {}
7070
if user_input is not None:
71-
try:
72-
info = await validate_input(self.hass, user_input)
73-
except CannotConnect:
74-
errors["base"] = "cannot_connect"
75-
except InvalidAuth:
76-
errors["base"] = "invalid_auth"
77-
except Exception: # pylint: disable=broad-except
78-
_LOGGER.exception("Unexpected exception")
79-
errors["base"] = "unknown"
80-
81-
if "base" not in errors:
71+
info, errors = await self._async_validate_or_error(user_input)
72+
if not errors:
8273
await self.async_set_unique_id(info["mac_addr"])
8374
self._abort_if_unique_id_configured()
8475
return self.async_create_entry(title=info["title"], data=user_input)
@@ -119,8 +110,31 @@ async def async_step_zeroconf(self, discovery_info):
119110

120111
async def async_step_import(self, user_input):
121112
"""Handle import."""
113+
if user_input:
114+
info, errors = await self._async_validate_or_error(user_input)
115+
if not errors:
116+
await self.async_set_unique_id(
117+
info["mac_addr"], raise_on_progress=False
118+
)
119+
self._abort_if_unique_id_configured()
120+
return self.async_create_entry(title=info["title"], data=user_input)
122121
return await self.async_step_user(user_input)
123122

123+
async def _async_validate_or_error(self, user_input):
124+
"""Validate doorbird or error."""
125+
errors = {}
126+
info = {}
127+
try:
128+
info = await validate_input(self.hass, user_input)
129+
except CannotConnect:
130+
errors["base"] = "cannot_connect"
131+
except InvalidAuth:
132+
errors["base"] = "invalid_auth"
133+
except Exception: # pylint: disable=broad-except
134+
_LOGGER.exception("Unexpected exception")
135+
errors["base"] = "unknown"
136+
return info, errors
137+
124138
@staticmethod
125139
@callback
126140
def async_get_options_flow(config_entry):

homeassistant/components/ipp/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"domain": "ipp",
33
"name": "Internet Printing Protocol (IPP)",
44
"documentation": "https://www.home-assistant.io/integrations/ipp",
5-
"requirements": ["pyipp==0.9.0"],
5+
"requirements": ["pyipp==0.9.1"],
66
"codeowners": ["@ctalkington"],
77
"config_flow": true,
88
"quality_scale": "platinum",

homeassistant/components/kef/media_player.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
SERVICE_SUB_DB = "set_sub_db"
6868
SERVICE_UPDATE_DSP = "update_dsp"
6969

70-
DSP_SCAN_INTERVAL = 3600
70+
DSP_SCAN_INTERVAL = timedelta(seconds=3600)
7171

7272
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
7373
{

homeassistant/components/lutron_caseta/manifest.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"domain": "lutron_caseta",
33
"name": "Lutron Caseta",
44
"documentation": "https://www.home-assistant.io/integrations/lutron_caseta",
5-
"requirements": ["pylutron-caseta==0.6.0"],
6-
"dependencies": [],
5+
"requirements": ["pylutron-caseta==0.6.1"],
76
"codeowners": ["@swails"]
87
}

homeassistant/components/modbus/__init__.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import asyncio
33
import logging
44

5+
from async_timeout import timeout
56
from pymodbus.client.asynchronous import schedulers
67
from pymodbus.client.asynchronous.serial import AsyncModbusSerialClient as ClientSerial
78
from pymodbus.client.asynchronous.tcp import AsyncModbusTCPClient as ClientTCP
@@ -246,7 +247,12 @@ async def _read(self, unit, address, count, func):
246247
await self._connect_delay()
247248
async with self._lock:
248249
kwargs = {"unit": unit} if unit else {}
249-
result = await func(address, count, **kwargs)
250+
try:
251+
async with timeout(self._config_timeout):
252+
result = await func(address, count, **kwargs)
253+
except asyncio.TimeoutError:
254+
result = None
255+
250256
if isinstance(result, (ModbusException, ExceptionResponse)):
251257
_LOGGER.error("Hub %s Exception (%s)", self._config_name, result)
252258
return result
@@ -256,7 +262,11 @@ async def _write(self, unit, address, value, func):
256262
await self._connect_delay()
257263
async with self._lock:
258264
kwargs = {"unit": unit} if unit else {}
259-
await func(address, value, **kwargs)
265+
try:
266+
async with timeout(self._config_timeout):
267+
func(address, value, **kwargs)
268+
except asyncio.TimeoutError:
269+
return
260270

261271
async def read_coils(self, unit, address, count):
262272
"""Read coils."""

homeassistant/components/octoprint/sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
3232
"If you do not want to have your printer on <br />"
3333
" at all times, and you would like to monitor <br /> "
3434
"temperatures, please add <br />"
35-
"bed and/or number&#95of&#95tools to your configuration <br />"
35+
"bed and/or number&#95;of&#95;tools to your configuration <br />"
3636
"and restart.",
3737
title=NOTIFICATION_TITLE,
3838
notification_id=NOTIFICATION_ID,

homeassistant/components/recollect_waste/sensor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Support for Recollect Waste curbside collection pickup."""
2+
from datetime import timedelta
23
import logging
34

45
import recollect_waste
@@ -16,7 +17,7 @@
1617
CONF_SERVICE_ID = "service_id"
1718
DEFAULT_NAME = "recollect_waste"
1819
ICON = "mdi:trash-can-outline"
19-
SCAN_INTERVAL = 86400
20+
SCAN_INTERVAL = timedelta(days=1)
2021

2122

2223
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(

0 commit comments

Comments
 (0)