Skip to content

Commit ef489aa

Browse files
authored
Merge pull request #35315 from home-assistant/rc
2 parents d2179e5 + 0050101 commit ef489aa

File tree

8 files changed

+57
-14
lines changed

8 files changed

+57
-14
lines changed

homeassistant/components/modbus/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ def setup(self):
188188
bytesize=self._config_bytesize,
189189
parity=self._config_parity,
190190
timeout=self._config_timeout,
191+
retry_on_empty=True,
191192
)
192193
elif self._config_type == "rtuovertcp":
193194
self._client = ModbusTcpClient(

homeassistant/components/modbus/switch.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,12 @@ def update(self):
273273
def _read_register(self) -> Optional[int]:
274274
try:
275275
if self._register_type == CALL_TYPE_REGISTER_INPUT:
276-
result = self._hub.read_input_registers(self._slave, self._register, 1)
276+
result = self._hub.read_input_registers(
277+
self._slave, self._verify_register, 1
278+
)
277279
else:
278280
result = self._hub.read_holding_registers(
279-
self._slave, self._register, 1
281+
self._slave, self._verify_register, 1
280282
)
281283
except ConnectionException:
282284
self._available = False

homeassistant/components/notion/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,14 @@ async def async_update(self):
196196
results = await asyncio.gather(*tasks.values(), return_exceptions=True)
197197
for attr, result in zip(tasks, results):
198198
if isinstance(result, NotionError):
199-
_LOGGER.error("There was an error while updating %s: %s", attr, result)
199+
_LOGGER.error(
200+
"There was a Notion error while updating %s: %s", attr, result
201+
)
202+
continue
203+
if isinstance(result, Exception):
204+
_LOGGER.error(
205+
"There was an unknown error while updating %s: %s", attr, result
206+
)
200207
continue
201208

202209
holding_pen = getattr(self, attr)

homeassistant/components/samsungtv/bridge.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,4 +259,6 @@ def _get_remote(self):
259259
except ConnectionFailure:
260260
self._notify_callback()
261261
raise
262+
except WebSocketException:
263+
self._remote = None
262264
return self._remote

homeassistant/components/sms/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
)
1818

1919

20-
async def async_setup(hass, config):
20+
def setup(hass, config):
2121
"""Configure Gammu state machine."""
2222
conf = config[DOMAIN]
2323
device = conf.get(CONF_DEVICE)

homeassistant/components/unifi/config_flow.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,20 @@ async def async_step_device_tracker(self, user_input=None):
199199
self.options.update(user_input)
200200
return await self.async_step_client_control()
201201

202-
ssids = list(self.controller.api.wlans) + [
203-
f"{wlan.name}{wlan.name_combine_suffix}"
204-
for wlan in self.controller.api.wlans.values()
205-
if not wlan.name_combine_enabled
206-
]
207-
ssid_filter = {ssid: ssid for ssid in sorted(ssids)}
202+
ssids = (
203+
set(self.controller.api.wlans)
204+
| {
205+
f"{wlan.name}{wlan.name_combine_suffix}"
206+
for wlan in self.controller.api.wlans.values()
207+
if not wlan.name_combine_enabled
208+
}
209+
| {
210+
wlan["name"]
211+
for ap in self.controller.api.devices.values()
212+
for wlan in ap.raw.get("wlan_overrides", [])
213+
}
214+
)
215+
ssid_filter = {ssid: ssid for ssid in sorted(list(ssids))}
208216

209217
return self.async_show_form(
210218
step_id="device_tracker",

homeassistant/const.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Constants used by Home Assistant components."""
22
MAJOR_VERSION = 0
33
MINOR_VERSION = 109
4-
PATCH_VERSION = "4"
4+
PATCH_VERSION = "5"
55
__short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
66
__version__ = f"{__short_version__}.{PATCH_VERSION}"
77
REQUIRED_PYTHON_VER = (3, 7, 0)

tests/components/unifi/test_config_flow.py

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,29 @@
3333

3434
CLIENTS = [{"mac": "00:00:00:00:00:01"}]
3535

36+
DEVICES = [
37+
{
38+
"board_rev": 21,
39+
"device_id": "mock-id",
40+
"ip": "10.0.1.1",
41+
"last_seen": 0,
42+
"mac": "00:00:00:00:01:01",
43+
"model": "U7PG2",
44+
"name": "access_point",
45+
"state": 1,
46+
"type": "uap",
47+
"version": "4.0.80.10875",
48+
"wlan_overrides": [
49+
{
50+
"name": "SSID 3",
51+
"radio": "na",
52+
"radio_name": "wifi1",
53+
"wlan_id": "012345678910111213141516",
54+
},
55+
],
56+
}
57+
]
58+
3659
WLANS = [
3760
{"name": "SSID 1"},
3861
{"name": "SSID 2", "name_combine_enabled": False, "name_combine_suffix": "_IOT"},
@@ -319,7 +342,7 @@ async def test_flow_fails_unknown_problem(hass, aioclient_mock):
319342
async def test_option_flow(hass):
320343
"""Test config flow options."""
321344
controller = await setup_unifi_integration(
322-
hass, clients_response=CLIENTS, wlans_response=WLANS
345+
hass, clients_response=CLIENTS, devices_response=DEVICES, wlans_response=WLANS
323346
)
324347

325348
result = await hass.config_entries.options.async_init(
@@ -335,7 +358,7 @@ async def test_option_flow(hass):
335358
CONF_TRACK_CLIENTS: False,
336359
CONF_TRACK_WIRED_CLIENTS: False,
337360
CONF_TRACK_DEVICES: False,
338-
CONF_SSID_FILTER: ["SSID 1", "SSID 2_IOT"],
361+
CONF_SSID_FILTER: ["SSID 1", "SSID 2_IOT", "SSID 3"],
339362
CONF_DETECTION_TIME: 100,
340363
},
341364
)
@@ -360,7 +383,7 @@ async def test_option_flow(hass):
360383
CONF_TRACK_CLIENTS: False,
361384
CONF_TRACK_WIRED_CLIENTS: False,
362385
CONF_TRACK_DEVICES: False,
363-
CONF_SSID_FILTER: ["SSID 1", "SSID 2_IOT"],
386+
CONF_SSID_FILTER: ["SSID 1", "SSID 2_IOT", "SSID 3"],
364387
CONF_DETECTION_TIME: 100,
365388
CONF_IGNORE_WIRED_BUG: False,
366389
CONF_POE_CLIENTS: False,

0 commit comments

Comments
 (0)