Skip to content

Commit

Permalink
Merge pull request #42 from mdeweerd/dev
Browse files Browse the repository at this point in the history
Fix deconz import & remove zigpy_cc import
  • Loading branch information
mdeweerd authored Mar 10, 2022
2 parents 11c93b2 + f4c819d commit ce6d2f0
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions custom_components/zha_toolkit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,12 @@ def get_radiotype(app):
except Exception: # nosec
pass

try:
from zigpy_cc.api import API

if isinstance(app._api, API):
return RadioType.ZIGPY_CC
except Exception: # nosec
pass
# try:
# from zigpy_cc.api import API
# if isinstance(app._api, API):
# return RadioType.ZIGPY_CC
# except Exception: # nosec
# pass

LOGGER.debug("Type recognition for '%s' not implemented", type(app))
return RadioType.UNKNOWN
Expand Down Expand Up @@ -175,9 +174,9 @@ def get_radio_version(app):
if hasattr(app, "_api"):
rt = get_radiotype(app)
if rt == RadioType.DECONZ:
import deconz
import zigpy_deconz

return deconz.__version__
return zigpy_deconz.__version__
if rt == RadioType.ZIGATE:
import zigpy_zigate

Expand All @@ -186,10 +185,9 @@ def get_radio_version(app):
import zigpy_xbee

return zigpy_xbee.__version__
if rt == RadioType.ZIGPY_CC:
import zigpy_cc

return zigpy_cc.__version__
# if rt == RadioType.ZIGPY_CC:
# import zigpy_cc
# return zigpy_cc.__version__

LOGGER.debug("Type recognition for '%s' not implemented", type(app))
return None
Expand Down

0 comments on commit ce6d2f0

Please sign in to comment.