From c1c4b41a97c2704d0d44c0db3201f7af607ee1d5 Mon Sep 17 00:00:00 2001 From: tomaae <23486452+tomaae@users.noreply.github.com> Date: Sun, 3 May 2020 15:04:16 +0200 Subject: [PATCH] fixed queue switch status #40 --- custom_components/mikrotik_router/mikrotik_controller.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/mikrotik_router/mikrotik_controller.py b/custom_components/mikrotik_router/mikrotik_controller.py index de2488d..4d1a154 100644 --- a/custom_components/mikrotik_router/mikrotik_controller.py +++ b/custom_components/mikrotik_router/mikrotik_controller.py @@ -278,9 +278,6 @@ class MikrotikControllerData: if self.api.connected(): await self.hass.async_add_executor_job(self.get_dns) - if self.api.connected(): - await self.hass.async_add_executor_job(self.get_queue) - self.lock.release() # --------------------------- @@ -417,6 +414,9 @@ class MikrotikControllerData: if self.api.connected(): await self.hass.async_add_executor_job(self.process_accounting) + if self.api.connected(): + await self.hass.async_add_executor_job(self.get_queue) + async_dispatcher_send(self.hass, self.signal_update) self.lock.release()