Skip to content

Commit

Permalink
Merge pull request #153 from mdeweerd/dev
Browse files Browse the repository at this point in the history
Adjust for 2023.3 - zigpy radio package version
  • Loading branch information
mdeweerd authored Mar 2, 2023
2 parents 02030f5 + a1f8994 commit 1d93d24
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 8 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/stats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ jobs:
ref: ${{ steps.extract_branch.outputs.branch }}
fetch-depth: 0
- run: ${{ github.workspace }}/.github/scripts/gen_stats.sh
- uses: stefanzweifel/git-auto-commit-action@v4
- name: Commit updated resources
uses: test-room-7/action-update-file@v1
with:
commit_message: '[Bot] stats - Update STATS.md'
file-path: STATS.md
commit-msg: '[Bot] stats - Update STATS.md'
github-token: ${{ secrets.GITHUB_TOKEN }}
# - uses: stefanzweifel/git-auto-commit-action@v4
# with:
# commit_message: '[Bot] stats - Update STATS.md'
# commit_user_name: stats
# commit_user_email: stats@nill
# commit_author: STATS BOT <stats>
39 changes: 33 additions & 6 deletions custom_components/zha_toolkit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,28 +186,55 @@ def get_radio(app):


def get_radio_version(app):
# pylint: disable=R0911
if hasattr(app, "_znp"):
import zigpy_znp

return zigpy_znp.__version__
if hasattr(zigpy_znp, "__version__"):
return zigpy_znp.__version__

import pkg_resources

return pkg_resources.get_distribution("zigpy_znp").version
if hasattr(app, "_ezsp"):
import bellows

return bellows.__version__
if hasattr(bellows, "__version__"):
return bellows.__version__

import pkg_resources

return pkg_resources.get_distribution("bellows").version
if hasattr(app, "_api"):
rt = get_radiotype(app)
if rt == RadioType.DECONZ:
import zigpy_deconz

return zigpy_deconz.__version__
if hasattr(zigpy_deconz, "__version__"):
return zigpy_deconz.__version__

import pkg_resources

return pkg_resources.get_distribution("zigpy_deconz").version
if rt == RadioType.ZIGATE:
import zigpy_zigate

return zigpy_zigate.__version__
if hasattr(zigpy_zigate, "__version__"):
return zigpy_zigate.__version__

import pkg_resources

return pkg_resources.get_distribution("zigpy_zigate").version
if rt == RadioType.XBEE:
import zigpy_xbee

return zigpy_xbee.__version__
if hasattr(zigpy_xbee, "__version__"):
return zigpy_xbee.__version__

import pkg_resources

return pkg_resources.get_distribution("zigpy_xbee").version

# if rt == RadioType.ZIGPY_CC:
# import zigpy_cc
# return zigpy_cc.__version__
Expand Down Expand Up @@ -649,7 +676,7 @@ def extractParams( # noqa: C901
if P.ENDPOINT in rawParams:
params[p.EP_ID] = str2int(rawParams[P.ENDPOINT])

# Destination endpoint to send command to
# Destination endpoint (e.g., target of data/cmds in bind_ieee)
if P.DST_ENDPOINT in rawParams:
params[p.DST_EP_ID] = str2int(rawParams[P.DST_ENDPOINT])

Expand Down

0 comments on commit 1d93d24

Please sign in to comment.