Skip to content

Commit

Permalink
Align system-channel-types for electricity (#3707)
Browse files Browse the repository at this point in the history
* Align system-channel-types for electricity

These are only used by one binding at the moment and it's very inconsistent to have power, voltage and current with the "electric" prefix and energy with "electrical".

Signed-off-by: Jan N. Klug <github@klug.nrw>
  • Loading branch information
J-N-K committed Jul 18, 2023
1 parent 3396ff7 commit 5a00bfd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ public class DefaultSystemChannelTypeProvider implements ChannelTypeProvider {
"electric-current");
public static final ChannelTypeUID SYSTEM_CHANNEL_TYPE_UID_ELECTRIC_VOLTAGE = new ChannelTypeUID(BINDING_ID,
"electric-voltage");
public static final ChannelTypeUID SYSTEM_CHANNEL_TYPE_UID_ELECTRICAL_ENERGY = new ChannelTypeUID(BINDING_ID,
"electrical-energy");
public static final ChannelTypeUID SYSTEM_CHANNEL_TYPE_UID_ELECTRIC_ENERGY = new ChannelTypeUID(BINDING_ID,
"electric-energy");

/**
* Signal strength default system wide {@link ChannelType}. Represents signal strength of a device as a number
Expand Down Expand Up @@ -391,8 +391,8 @@ public class DefaultSystemChannelTypeProvider implements ChannelTypeProvider {
* Electrical-energy: system wide {@link ChannelType} which shows the electrical energy
*/
public static final ChannelType SYSTEM_ELECTRICAL_ENERGY = ChannelTypeBuilder
.state(SYSTEM_CHANNEL_TYPE_UID_ELECTRICAL_ENERGY, "Electrical Energy", "Number:Energy")
.withDescription("Current electrical energy").withCategory("Energy")
.state(SYSTEM_CHANNEL_TYPE_UID_ELECTRIC_ENERGY, "Electric Energy", "Number:Energy")
.withDescription("Current electric energy").withCategory("Energy")
.withStateDescriptionFragment(
StateDescriptionFragmentBuilder.create().withReadOnly(true).withPattern("%.1f %unit%").build())
.withTags(List.of("Measurement", "Energy")).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void systemChannelTypesShouldBeAvailable() {
assertNotNull(systemChannelTypeProvider.getChannelType(SYSTEM_CHANNEL_TYPE_UID_ELECTRIC_POWER, null));
assertNotNull(systemChannelTypeProvider.getChannelType(SYSTEM_CHANNEL_TYPE_UID_ELECTRIC_CURRENT, null));
assertNotNull(systemChannelTypeProvider.getChannelType(SYSTEM_CHANNEL_TYPE_UID_ELECTRIC_VOLTAGE, null));
assertNotNull(systemChannelTypeProvider.getChannelType(SYSTEM_CHANNEL_TYPE_UID_ELECTRICAL_ENERGY, null));
assertNotNull(systemChannelTypeProvider.getChannelType(SYSTEM_CHANNEL_TYPE_UID_ELECTRIC_ENERGY, null));
}

@Test
Expand Down

0 comments on commit 5a00bfd

Please sign in to comment.