mirror of
https://github.com/andvikt/mega_hacs.git
synced 2025-12-11 17:14:28 +05:00
event monitoring propper restarting
This commit is contained in:
@@ -13,16 +13,18 @@ from .const import DOMAIN, CONF_CUSTOM, CONF_INVERT, EVENT_BINARY_SENSOR, LONG,
|
|||||||
_events_on = False
|
_events_on = False
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
async def _set_events_on():
|
async def _set_events_on():
|
||||||
global _events_on
|
global _events_on, _task_set_ev_on
|
||||||
await asyncio.sleep(10)
|
await asyncio.sleep(10)
|
||||||
_LOGGER.debug('events on')
|
_LOGGER.debug('events on')
|
||||||
_events_on = True
|
_events_on = True
|
||||||
|
|
||||||
|
|
||||||
def set_events_off():
|
def set_events_off():
|
||||||
global _events_on
|
global _events_on, _task_set_ev_on
|
||||||
_events_on = False
|
_events_on = False
|
||||||
|
_task_set_ev_on = None
|
||||||
|
|
||||||
_task_set_ev_on = None
|
_task_set_ev_on = None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user