Skip to content

Commit

Permalink
Merge pull request #18 from alexbarcelo/patch-1
Browse files Browse the repository at this point in the history
Update async_ usage (for Home Assistant 0.66+)
  • Loading branch information
ISO-B authored Apr 9, 2018
2 parents ed590b2 + 0bae2ee commit cffcb30
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion zigate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@

import asyncio
import logging
from homeassistant.util import async as hasync
try:
# Valid since HomeAssistant 0.66+
from homeassistant.util import async_ as hasync
except ImportError:
# backwards compatibility, with workaround to avoid reserved word "async"
# from homeassistant.util import async as hasync # <- invalid syntax in Python 3.7
import importlib
hasync = importlib.import_module("homeassistant.util.async")

import homeassistant.helpers.config_validation as cv
from homeassistant.const import (CONF_NAME, CONF_HOST, CONF_PORT)
Expand Down

0 comments on commit cffcb30

Please sign in to comment.