Skip to content

Commit 7e75390

Browse files
committed
Removed obsolete async_add_job
1 parent 07bcd10 commit 7e75390

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

custom_components/huawei_mesh_router/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
"iot_class": "local_polling",
1414
"issue_tracker": "https://github.com/vmakeev/huawei_mesh_router/issues",
1515
"requirements": ["pycryptodome>=3.12.0"],
16-
"version": "0.9.2"
16+
"version": "0.9.2.1"
1717
}

custom_components/huawei_mesh_router/switch.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def watch_for_additional_routers(
202202
@callback
203203
def on_router_added(device_mac: MAC_ADDR, router: ConnectedDevice) -> None:
204204
"""When a new mesh router is detected."""
205-
coordinator.hass.async_add_job(
205+
coordinator.hass.async_create_task(
206206
_add_nfc_if_available(
207207
coordinator, known_nfc_switches, device_mac, router, async_add_entities
208208
)
@@ -217,7 +217,7 @@ def on_router_added(device_mac: MAC_ADDR, router: ConnectedDevice) -> None:
217217
@callback
218218
def on_wireless_device_added(device_mac: MAC_ADDR, device: ConnectedDevice) -> None:
219219
"""When a new mesh router is detected."""
220-
coordinator.hass.async_add_job(
220+
coordinator.hass.async_create_task(
221221
_add_access_switch_if_available(
222222
coordinator,
223223
known_access_switches,
@@ -251,7 +251,7 @@ def watch_for_url_filters(coordinator, config_entry, async_add_entities):
251251
@callback
252252
def on_filter_added(filter_id: str, url_filter: UrlFilter) -> None:
253253
"""When a new filter is found."""
254-
coordinator.hass.async_add_job(
254+
coordinator.hass.async_create_task(
255255
_add_url_filter_switch_if_available(
256256
coordinator,
257257
known_url_filter_switches,
@@ -307,7 +307,7 @@ def watch_for_port_mappings(coordinator, config_entry, async_add_entities):
307307
@callback
308308
def on_port_mapping_added(port_mapping_id: str, port_mapping: PortMapping) -> None:
309309
"""When a new port mapping is found."""
310-
coordinator.hass.async_add_job(
310+
coordinator.hass.async_create_task(
311311
_add_port_mapping_switch_if_available(
312312
coordinator,
313313
known_port_mapping_switches,

custom_components/huawei_mesh_router/update_coordinator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def get_device_info(self, device_mac: MAC_ADDR | None = None) -> DeviceInfo | No
432432
def _safe_disconnect(self, api: HuaweiApi) -> None:
433433
"""Disconnect from API."""
434434
try:
435-
self.hass.async_add_job(api.disconnect)
435+
self.hass.async_create_task(api.disconnect())
436436
except Exception as ex:
437437
self._logger.warning("Can not schedule disconnect: %s", str(ex))
438438

0 commit comments

Comments
 (0)