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

Link add: Support linking Number channel to Switch Item with profile #2690

Merged
merged 1 commit into from
Jul 28, 2024

Conversation

florian-h05
Copy link
Contributor

Closes #1478.

@florian-h05
Copy link
Contributor Author

@rkoshak @ssalonen Would be great if you could have a look at the changes from this PR and tell me if you think that my logic is correct.

@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI bug Something isn't working and removed enhancement New feature or request labels Jul 26, 2024
@florian-h05 florian-h05 added this to the 4.3 milestone Jul 26, 2024
Copy link

relativeci bot commented Jul 26, 2024

#2149 Bundle Size — 10.77MiB (~+0.01%).

79c925a(current) vs fa85c07 main#2148(baseline)

Warning

Bundle contains 2 duplicate packages – View duplicate packages

Bundle metrics  no changes
                 Current
#2149
     Baseline
#2148
No change  Initial JS 1.88MiB 1.88MiB
No change  Initial CSS 607.91KiB 607.91KiB
No change  Cache Invalidation 18.11% 18.11%
No change  Chunks 223 223
No change  Assets 246 246
No change  Modules 2888 2888
No change  Duplicate Modules 149 149
No change  Duplicate Code 1.84% 1.84%
No change  Packages 97 97
No change  Duplicate Packages 2 2
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#2149
     Baseline
#2148
Regression  JS 8.96MiB (~+0.01%) 8.96MiB
No change  CSS 892.47KiB 892.47KiB
No change  Fonts 526.1KiB 526.1KiB
No change  Media 295.6KiB 295.6KiB
No change  IMG 140.74KiB 140.74KiB
No change  HTML 1.24KiB 1.24KiB
No change  Other 871B 871B

Bundle analysis reportBranch florian-h05:link-number-channel-...Project dashboard

@rkoshak
Copy link

rkoshak commented Jul 26, 2024

If I'm following the code correctly I think this looks right. The only part I can't tell easily is what is in the list of compatibleProfileTypes. I assume it would be those that work for Switch Items including stuff like hysteresis, script, map, etc.

@florian-h05
Copy link
Contributor Author

The only part I can't tell easily is what is in the list of compatibleProfileTypes.

This list is requested from the REST API and specific to the channel type. I only need to filter out the default and follow profiles if I want to link a Switch to a Number channel.

@florian-h05 florian-h05 marked this pull request as ready for review July 28, 2024 13:04
@florian-h05 florian-h05 requested a review from a team as a code owner July 28, 2024 13:04
@florian-h05 florian-h05 merged commit 6b2f264 into openhab:main Jul 28, 2024
8 checks passed
@florian-h05 florian-h05 deleted the link-number-channel-to-switch branch July 28, 2024 13:05
florian-h05 added a commit that referenced this pull request Dec 24, 2024
Regression from #2690.

Reported here:

https://community.openhab.org/t/enocean-impossible-to-link-a-rockerswitch-channel-with-an-item-in-main-ui-there-is-no-profile-available-for-the-selected-item/160987

When creating a Thing channel link to an item, the profile selection are
disabled. This presents two problems:

- It made linking a trigger channel to an item not possible, because a
profile must be selected, but they're disabled.
- Linking a non-trigger channel to a new item is possible, but selecting
a profile is not possible at link creation. The user has to create the
link without a profile first, then go back to edit the link in order to
assign a profile.

When editing a channel link, profile selection was possible for
unsupported profiles, e.g. when editing a link between a Switch Item and
a Number channel, one could edit the link to use the default or follow
profiles.

---------

Signed-off-by: Florian Hotze <[email protected]>
florian-h05 added a commit that referenced this pull request Dec 24, 2024
Regression from #2690.

Reported here:

https://community.openhab.org/t/enocean-impossible-to-link-a-rockerswitch-channel-with-an-item-in-main-ui-there-is-no-profile-available-for-the-selected-item/160987

When creating a Thing channel link to an item, the profile selection are
disabled. This presents two problems:

- It made linking a trigger channel to an item not possible, because a
profile must be selected, but they're disabled.
- Linking a non-trigger channel to a new item is possible, but selecting
a profile is not possible at link creation. The user has to create the
link without a profile first, then go back to edit the link in order to
assign a profile.

When editing a channel link, profile selection was possible for
unsupported profiles, e.g. when editing a link between a Switch Item and
a Number channel, one could edit the link to use the default or follow
profiles.

---------

Signed-off-by: Florian Hotze <[email protected]>
(cherry picked from commit bd9c6f0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working main ui Main UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Number channel cannot be linked to Switch Item (with profile)
2 participants