mirror of
https://github.com/andvikt/mega_hacs.git
synced 2026-11-02 21:48:44 +05:00
event monitoring propper restarting
This commit is contained in:
1 parent
3978ce2203
commit
f83cdaa583
1 file changed
+4
-2
@@ -13,16 +13,18 @@ from .const import DOMAIN, CONF_CUSTOM, CONF_INVERT, EVENT_BINARY_SENSOR, LONG,
|
||||
_events_on = False
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
async def _set_events_on():
|
||||
global _events_on
|
||||
global _events_on, _task_set_ev_on
|
||||
await asyncio.sleep(10)
|
||||
_LOGGER.debug('events on')
|
||||
_events_on = True
|
||||
|
||||
|
||||
def set_events_off():
|
||||
global _events_on
|
||||
global _events_on, _task_set_ev_on
|
||||
_events_on = False
|
||||
_task_set_ev_on = None
|
||||
|
||||
_task_set_ev_on = None
|
||||
|
||||
|
||||
Reference in new issue
Block a user