Align system-channel-types for electricity (#3707)

* 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>
pull/3712/head
J-N-K 2023-07-18 09:05:42 +02:00 committed by GitHub
parent 3396ff7758
commit 5a00bfdc41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -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
@ -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();

View File

@ -80,7 +80,7 @@ public class SystemWideChannelTypesTest extends JavaOSGiTest {
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