mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
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>
This commit is contained in:
+4
-4
@@ -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();
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user