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

[freeboxos] Fix command handling for DECT thing type #17274

Merged
merged 3 commits into from
Aug 18, 2024

Conversation

lolodomo
Copy link
Contributor

Related to comment in #17262

Signed-off-by: Laurent Garnier lg.hc@free.fr

Related to comment in openhab#17262

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
@lolodomo lolodomo added the bug An unexpected problem or unintended behavior of an add-on label Aug 17, 2024
@lolodomo lolodomo requested a review from clinique as a code owner August 17, 2024 12:40
@lolodomo lolodomo added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Aug 17, 2024
Copy link
Contributor

@clinique clinique left a comment

Choose a reason for hiding this comment

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

Apart from the fact that you seem to dislike enums, I approve. I like them because it a convenient way to document what's known of a given value.

@lolodomo
Copy link
Contributor Author

Apart from the fact that you seem to dislike enums, I approve. I like them because it a convenient way to document what's known of a given value.

It is not that I dislike enums, it is just that it can't work at it was. If you have a better solution, I am open.
Maybe one solution would be inside the Gson configuration to lowercase any enum when building the JSON ? If you know how to do that, I let you do and you can even restore the enums where I remove them to make the APIs working.

@clinique
Copy link
Contributor

Write a dedicated deserializer is an option but this would have a binding-wide impact, needed many checks to ensure it has no side effects somewhere else.
The simpler is :

    public enum Type {
        @SerializedName("fxs")
        FXS,
        @SerializedName("dect")
        DECT,
        UNKNOWN
    }

@lolodomo
Copy link
Contributor Author

The simpler is :

    public enum Type {
        @SerializedName("fxs")
        FXS,
        @SerializedName("dect")
        DECT,
        UNKNOWN
    }

With that, when serializing, FXS enum will then be converted into "fxs" ?
In that case, that would be the perfect solution.

@lolodomo
Copy link
Contributor Author

I am going to try on the other places I previously changed something.

@lolodomo
Copy link
Contributor Author

Tested and working for playing media, so I will update that PR and create other PRs for the previous changes I made.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
@lolodomo
Copy link
Contributor Author

@clinique : changed

Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

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

Thanks!

@jlaur jlaur merged commit 25ec3a3 into openhab:main Aug 18, 2024
5 checks passed
@jlaur jlaur added this to the 4.3 milestone Aug 18, 2024
@lolodomo lolodomo deleted the freeboxos_fix_dect branch August 18, 2024 11:30
digitaldan pushed a commit to digitaldan/openhab-addons that referenced this pull request Aug 29, 2024
Related to comment in openhab#17262

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
pgfeller pushed a commit to pgfeller/openhab-addons that referenced this pull request Sep 29, 2024
Related to comment in openhab#17262

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Signed-off-by: Patrik Gfeller <patrik.gfeller@proton.me>
joni1993 pushed a commit to joni1993/openhab-addons that referenced this pull request Oct 15, 2024
Related to comment in openhab#17262

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
matchews pushed a commit to matchews/openhab-addons that referenced this pull request Oct 18, 2024
Related to comment in openhab#17262

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants