Skip to content
Merged

0.109.5 #35315

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions homeassistant/components/modbus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def setup(self):
bytesize=self._config_bytesize,
parity=self._config_parity,
timeout=self._config_timeout,
retry_on_empty=True,
)
elif self._config_type == "rtuovertcp":
self._client = ModbusTcpClient(
Expand Down
6 changes: 4 additions & 2 deletions homeassistant/components/modbus/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,12 @@ def update(self):
def _read_register(self) -> Optional[int]:
try:
if self._register_type == CALL_TYPE_REGISTER_INPUT:
result = self._hub.read_input_registers(self._slave, self._register, 1)
result = self._hub.read_input_registers(
self._slave, self._verify_register, 1
)
else:
result = self._hub.read_holding_registers(
self._slave, self._register, 1
self._slave, self._verify_register, 1
)
except ConnectionException:
self._available = False
Expand Down
9 changes: 8 additions & 1 deletion homeassistant/components/notion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,14 @@ async def async_update(self):
results = await asyncio.gather(*tasks.values(), return_exceptions=True)
for attr, result in zip(tasks, results):
if isinstance(result, NotionError):
_LOGGER.error("There was an error while updating %s: %s", attr, result)
_LOGGER.error(
"There was a Notion error while updating %s: %s", attr, result
)
continue
if isinstance(result, Exception):
_LOGGER.error(
"There was an unknown error while updating %s: %s", attr, result
)
continue

holding_pen = getattr(self, attr)
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/samsungtv/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,6 @@ def _get_remote(self):
except ConnectionFailure:
self._notify_callback()
raise
except WebSocketException:
self._remote = None
return self._remote
2 changes: 1 addition & 1 deletion homeassistant/components/sms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
)


async def async_setup(hass, config):
def setup(hass, config):
"""Configure Gammu state machine."""
conf = config[DOMAIN]
device = conf.get(CONF_DEVICE)
Expand Down
20 changes: 14 additions & 6 deletions homeassistant/components/unifi/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,20 @@ async def async_step_device_tracker(self, user_input=None):
self.options.update(user_input)
return await self.async_step_client_control()

ssids = list(self.controller.api.wlans) + [
f"{wlan.name}{wlan.name_combine_suffix}"
for wlan in self.controller.api.wlans.values()
if not wlan.name_combine_enabled
]
ssid_filter = {ssid: ssid for ssid in sorted(ssids)}
ssids = (
set(self.controller.api.wlans)
| {
f"{wlan.name}{wlan.name_combine_suffix}"
for wlan in self.controller.api.wlans.values()
if not wlan.name_combine_enabled
}
| {
wlan["name"]
for ap in self.controller.api.devices.values()
for wlan in ap.raw.get("wlan_overrides", [])
}
)
ssid_filter = {ssid: ssid for ssid in sorted(list(ssids))}

return self.async_show_form(
step_id="device_tracker",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/const.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Constants used by Home Assistant components."""
MAJOR_VERSION = 0
MINOR_VERSION = 109
PATCH_VERSION = "4"
PATCH_VERSION = "5"
__short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__ = f"{__short_version__}.{PATCH_VERSION}"
REQUIRED_PYTHON_VER = (3, 7, 0)
Expand Down
29 changes: 26 additions & 3 deletions tests/components/unifi/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,29 @@

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

DEVICES = [
{
"board_rev": 21,
"device_id": "mock-id",
"ip": "10.0.1.1",
"last_seen": 0,
"mac": "00:00:00:00:01:01",
"model": "U7PG2",
"name": "access_point",
"state": 1,
"type": "uap",
"version": "4.0.80.10875",
"wlan_overrides": [
{
"name": "SSID 3",
"radio": "na",
"radio_name": "wifi1",
"wlan_id": "012345678910111213141516",
},
],
}
]

WLANS = [
{"name": "SSID 1"},
{"name": "SSID 2", "name_combine_enabled": False, "name_combine_suffix": "_IOT"},
Expand Down Expand Up @@ -319,7 +342,7 @@ async def test_flow_fails_unknown_problem(hass, aioclient_mock):
async def test_option_flow(hass):
"""Test config flow options."""
controller = await setup_unifi_integration(
hass, clients_response=CLIENTS, wlans_response=WLANS
hass, clients_response=CLIENTS, devices_response=DEVICES, wlans_response=WLANS
)

result = await hass.config_entries.options.async_init(
Expand All @@ -335,7 +358,7 @@ async def test_option_flow(hass):
CONF_TRACK_CLIENTS: False,
CONF_TRACK_WIRED_CLIENTS: False,
CONF_TRACK_DEVICES: False,
CONF_SSID_FILTER: ["SSID 1", "SSID 2_IOT"],
CONF_SSID_FILTER: ["SSID 1", "SSID 2_IOT", "SSID 3"],
CONF_DETECTION_TIME: 100,
},
)
Expand All @@ -360,7 +383,7 @@ async def test_option_flow(hass):
CONF_TRACK_CLIENTS: False,
CONF_TRACK_WIRED_CLIENTS: False,
CONF_TRACK_DEVICES: False,
CONF_SSID_FILTER: ["SSID 1", "SSID 2_IOT"],
CONF_SSID_FILTER: ["SSID 1", "SSID 2_IOT", "SSID 3"],
CONF_DETECTION_TIME: 100,
CONF_IGNORE_WIRED_BUG: False,
CONF_POE_CLIENTS: False,
Expand Down