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

[knx] DPT 1 to support Switch and Contact #16238

Merged
merged 1 commit into from Jan 21, 2024

Conversation

holgerfriedrich
Copy link
Member

  • Allow assigning Switch or Contact to most of the DPT 1 subtypes (exceptions 1.008 UpDownType, 1.010 StopMoveType, 1.022 DecimalType).
  • Tests for all published subtypes for DPT 1.
  • Fix sending of DPT 1.022.

This PR has been initiated because of a discussion in the (German speaking) KNX User Forum.
DPT1 implementation had a rather strict mapping to types before. A Contact could not be used if the specific DPT was added to the group address definition ga="1.011:<17/1/38", unless it was 1.009 or 1.019. As only subtypes 009 and 019 were mapped to OpenClosedType and the fallback for other DPTs was OnOffType,

* Allow assigning Switch or Contact to most of the DPT 1 subtypes
(exceptions 1.008 UpDownType, 1.010 StopMoveType, 1.022 DecimalType).
* Tests for all published subtypes for DPT 1.
* Fix sending of DPT 1.022.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
@lsiepel
Copy link
Contributor

lsiepel commented Jan 8, 2024

I guess this does not fix #9747, but does it in someway improve that?

@holgerfriedrich
Copy link
Member Author

It does not, and this is intended.

It allows to map DPTs that could previously be mapped to switch items also to be mapped to contact items.
It was possible to do so as well before, but with the workaround to force the DPT to 1.009 or 1.019.
I think it is more convenient if users can configure the same DPTs as in ETS.

@holgerfriedrich holgerfriedrich added the enhancement An enhancement or new feature for an existing add-on label Jan 12, 2024
Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

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

LGTM, double check before i merge: Would it be usefull to have a note/comment in the readme about this DPT 1 'fallback' functionality'?

@holgerfriedrich
Copy link
Member Author

@lsiepel Thanks for asking. We do not state possible conversions in the README, just the default DPTs for the different types. So you could just go on....

@lsiepel lsiepel merged commit ba35e8d into openhab:main Jan 21, 2024
3 checks passed
@lsiepel lsiepel added this to the 4.2 milestone Jan 21, 2024
@holgerfriedrich holgerfriedrich deleted the pr-knx-dpt1 branch January 21, 2024 21:18
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Jan 27, 2024
* Allow assigning Switch or Contact to most of the DPT 1 subtypes
(exceptions 1.008 UpDownType, 1.010 StopMoveType, 1.022 DecimalType).
* Tests for all published subtypes for DPT 1.
* Fix sending of DPT 1.022.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
ulbi pushed a commit to ulbi/openhab-addons that referenced this pull request Jan 28, 2024
* Allow assigning Switch or Contact to most of the DPT 1 subtypes
(exceptions 1.008 UpDownType, 1.010 StopMoveType, 1.022 DecimalType).
* Tests for all published subtypes for DPT 1.
* Fix sending of DPT 1.022.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Signed-off-by: René Ulbricht <rene_ulbricht@outlook.com>
austvik pushed a commit to austvik/openhab-addons that referenced this pull request Mar 27, 2024
* Allow assigning Switch or Contact to most of the DPT 1 subtypes
(exceptions 1.008 UpDownType, 1.010 StopMoveType, 1.022 DecimalType).
* Tests for all published subtypes for DPT 1.
* Fix sending of DPT 1.022.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants