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

Refactor channel converter to support device configuration during discovery #617

Merged
merged 1 commit into from Dec 4, 2020

Conversation

cdjackson
Copy link
Contributor

This refactors the converters to allow the initialisation to be performed during discovery while devices are awake. This is necessary as channel discovery at a later time (ie once the thing is created) may fail for sleepy devices if the period between discovery and the thing creation is more than a few seconds (which is highly likely!).

In itself, this works, however as OH provides no way to parse the dynamic channels from the discovery handler to the new thing, when the thing handler is created the binding will again perform the channel discovery. For devices that are sleeping, this will fail - possibly this is ok, although it will likely indicate that the initialisation fails which may increase polling. In any case, the reporting should have been configured during discovery, so this should be working fine.

Ultimately to fully resolve this, the full discovery, including the static thing definition, all needs to be performed during discovery, and then there needs to be a way to parse this information to the thing handler.

This could be done using json encoded properties. Ideally OH would provide the ability to pass channel information to the DiscoveryResultBuilder (but it seems unlikely that OH would want to add this!).

Alternatively we could look to provide this support in the device storage - needs more thought, but this PR provides an initial intermediate step.

Adds partial support for #527.

Signed-off-by: Chris Jackson chris@cd-jackson.com

…covery

Signed-off-by: Chris Jackson <chris@cd-jackson.com>
@cdjackson cdjackson merged commit cbab07d into openhab:2.5.x Dec 4, 2020
@cdjackson cdjackson deleted the refactor-channel-converter branch December 4, 2020 08:43
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/zigbee-discovery-updates/109449/1

@cdjackson cdjackson restored the refactor-channel-converter branch December 4, 2020 17:11
@kaikreuzer kaikreuzer added this to the 3.0.0.M5 milestone Dec 6, 2020
@cdjackson cdjackson deleted the refactor-channel-converter branch December 23, 2020 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants