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

Add category for system channel type 'power' #2069

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class DefaultSystemChannelTypeProvider implements ChannelTypeProvider {
* on (low battery) and off (battery ok).
*/
public static final ChannelType SYSTEM_CHANNEL_LOW_BATTERY = ChannelTypeBuilder
.state(new ChannelTypeUID(BINDING_ID, "low-battery"), "Low Battery", "Switch").withCategory("Battery")
.state(new ChannelTypeUID(BINDING_ID, "low-battery"), "Low Battery", "Switch").withCategory("LowBattery")
Copy link
Member

Choose a reason for hiding this comment

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

How did it happen that we have a lowbattery property besides batterylevel? That does not make much sense to me - the property that is measured is in both cases the batterylevel - just the purpose is a different one.

The category is only used for the icons, though, right? So as an icon for that channel type, that is ok to use, so nothing against this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sry, I do not understand. Are you talking about the default system channel types? If so I cannot give you a proper answer. They probably have been introduced before my openHAB start. 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And yes, the main purpose of categories is to render the icons. Which looks a little bit out-dated next to UoM and Semantics. Might be worth to rethink them.

Copy link
Member

Choose a reason for hiding this comment

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

All fine, I think I was rather talking to myself ;-)

.withStateDescriptionFragment(StateDescriptionFragmentBuilder.create().withReadOnly(true).build()).build();

/**
Expand Down Expand Up @@ -135,7 +135,7 @@ public class DefaultSystemChannelTypeProvider implements ChannelTypeProvider {
*/
public static final ChannelType SYSTEM_POWER = ChannelTypeBuilder
.state(new ChannelTypeUID(BINDING_ID, "power"), "Power", "Switch")
.withDescription("Device is operable when channel has state ON").build();
.withDescription("Device is operable when channel has state ON").withCategory("Switch").build();

/**
* Location: default system wide {@link ChannelType} which displays a location
Expand Down