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

[wemo] Refactor Insight Switch parser #12380

Merged
merged 2 commits into from
Feb 27, 2022

Conversation

jlaur
Copy link
Contributor

@jlaur jlaur commented Feb 26, 2022

Fixes #12105
Continuation of #12120

Signed-off-by: Jacob Laursen jacob-github@vindvejr.dk

Refactoring: Parsing of WeMo Insight Switch data string has been extracted to separate class:

  • Improved robustness: Number of provided values is no longer fixed/assumed.
  • Improved robustness: Non-numeric values could throw NumberFormatException.
  • Reduced redundancy: Each conversion if only written once (in private methods).
  • Unit tests are provided.

@jlaur jlaur added the enhancement An enhancement or new feature for an existing add-on label Feb 26, 2022
@jlaur jlaur requested a review from hmerk as a code owner February 26, 2022 23:56
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@jlaur jlaur force-pushed the 12105-wemo-insight-parser-class branch from 4152ea2 to b30c1a4 Compare February 27, 2022 00:08
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@jlaur jlaur requested a review from lolodomo February 27, 2022 13:47
Copy link
Contributor

@hmerk hmerk left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@lolodomo lolodomo left a comment

Choose a reason for hiding this comment

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

LGTM

@lolodomo lolodomo merged commit d56b2e4 into openhab:main Feb 27, 2022
@lolodomo lolodomo added this to the 3.3 milestone Feb 27, 2022
NickWaterton pushed a commit to NickWaterton/openhab-addons that referenced this pull request Apr 27, 2022
* Extract Insight parser to separate class and provide unit tests

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Nick Waterton <n.waterton@outlook.com>
andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
* Extract Insight parser to separate class and provide unit tests

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Nov 12, 2022
* Extract Insight parser to separate class and provide unit tests

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
psmedley pushed a commit to psmedley/openhab-addons that referenced this pull request Feb 23, 2023
* Extract Insight parser to separate class and provide unit tests

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
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.

[wemo] Refactoring WeMo Insight Switch parser
3 participants