Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional endpoint configuration option #1048

Merged
merged 7 commits into from Sep 18, 2022
Merged

Conversation

prairiesnpr
Copy link
Contributor

This PR adds a configuration option to allow adding additional endpoints.

This is required for xbee end devices as they require 0xE6 and 0xE8 endpoints and by default zigpy ignores those.

Example configuration.

zha:
  zigpy_config:
    additional_endpoints:
      - endpoint: 0xE6
        profile: 0xC105
        device_type: 0x0000
        device_version: 0b0000
        input_clusters: []
        output_clusters: [0x21]
      - endpoint: 0xE8
        profile: 0xC105
        device_type: 0x0000
        device_version: 0b0000
        input_clusters: []
        output_clusters: [0x21]

@codecov-commenter
Copy link

codecov-commenter commented Sep 17, 2022

Codecov Report

Base: 99.75% // Head: 99.61% // Decreases project coverage by -0.13% ⚠️

Coverage data is based on head (e31d4e3) compared to base (6162503).
Patch coverage: 33.33% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1048      +/-   ##
==========================================
- Coverage   99.75%   99.61%   -0.14%     
==========================================
  Files          46       46              
  Lines        7202     7216      +14     
==========================================
+ Hits         7184     7188       +4     
- Misses         18       28      +10     
Impacted Files Coverage Δ
zigpy/application.py 98.17% <0.00%> (-0.61%) ⬇️
zigpy/config/validators.py 82.60% <27.27%> (-17.40%) ⬇️
zigpy/config/__init__.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@puddly puddly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I've added a few comments regarding the config schema parsing.

zigpy/config/__init__.py Outdated Show resolved Hide resolved
@@ -539,6 +540,9 @@ async def register_endpoints(self):
)
)

for add_endpoint in self.config.get(CONF_ADDITIONAL_ENDPOINTS):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the endpoint dictionary is parsed in zigpy/config/__init__.py, this code can just become:

for endpoint in self.config[conf.CONF_ADDITIONAL_ENDPOINTS]:
    await self.add_endpoint(endpoint)

@@ -10,6 +10,7 @@
import zigpy.appdb
import zigpy.backups
import zigpy.config as conf
from zigpy.config import CONF_ADDITIONAL_ENDPOINTS
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zigpy.config is imported as conf on the line above, you don't need to add another one.

@Hedda
Copy link
Contributor

Hedda commented Sep 18, 2022

@pipiche38 could this also be related to zigbeefordomoticz/Domoticz-Zigbee#1145 or is that issue only on the coordinator side?

@prairiesnpr, for reference, exactly which Zigbee USB radio adapter are you using to test and exactly which firmware does it have?

@pipiche38
Copy link
Contributor

@pipiche38 could this also be related to zigbeefordomoticz/Domoticz-Zigbee#1145 or is that issue only on the coordinator side?

@prairiesnpr, for reference, exactly which Zigbee USB radio adapter are you using to test and exactly which firmware does it have?

My understanding is that it should be done at the radio lib level ( ZNP, deConz or EZSP) because every coordinator as it is way to handle it.
For exemple, ZNP and deConz we had to add a number of Ep to get our Wiser , Livolo devices working, while on EZSP it looks like it is using an other mecanism and we didn't have to do it.
So the PR made at zigpy level, might be against the EZSP part

@prairiesnpr
Copy link
Contributor Author

@pipiche38 could this also be related to zigbeefordomoticz/Domoticz-Zigbee#1145 or is that issue only on the coordinator side?

@prairiesnpr, for reference, exactly which Zigbee USB radio adapter are you using to test and exactly which firmware does it have?

It's one of Tube's Poe models. cc2652p2, firmware 20220219. Will also need zigpy/zigpy-znp#175 for this to work.

@puddly puddly merged commit 1a4e509 into zigpy:dev Sep 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants