Rename thing type shellypro2-relay< to shellypro to match the refactores (#18931)

thing discovery.

Signed-off-by: Markus Michels <markus7017@gmail.com>
This commit is contained in:
Markus Michels
2025-07-12 12:28:52 +02:00
committed by GitHub
parent 86d9f878a7
commit 7e547593bb
7 changed files with 16 additions and 24 deletions
@@ -57,7 +57,7 @@ public class ShellyBindingConstants {
THING_TYPE_SHELLY1MINI, THING_TYPE_SHELLYPMMINI, THING_TYPE_SHELLY1PMMINI,
// Shelly Pro
THING_TYPE_SHELLYPRO1, THING_TYPE_SHELLYPRO1PM, THING_TYPE_SHELLYPRO1CB, THING_TYPE_SHELLYPRO2_RELAY,
THING_TYPE_SHELLYPRO1, THING_TYPE_SHELLYPRO1PM, THING_TYPE_SHELLYPRO1CB, THING_TYPE_SHELLYPRO2,
THING_TYPE_SHELLYPRO2PM_RELAY, THING_TYPE_SHELLYPRO2PM_ROLLER, THING_TYPE_SHELLYPRO3,
THING_TYPE_SHELLYPRO3EM, THING_TYPE_SHELLYPROEM50, THING_TYPE_SHELLYPRO4PM,
@@ -248,9 +248,6 @@ public class Shelly2ApiRpc extends Shelly2ApiClient implements ShellyApiInterfac
profile.status.relays.add(new ShellySettingsRelay());
relayStatus.relays.add(new ShellyShortStatusRelay());
}
if (getString(profile.device.mode).isEmpty()) {
profile.device.mode = SHELLY_MODE_RELAY; // Pro 2 does not return profile
}
}
if (profile.numInputs > 0) {
@@ -270,7 +267,7 @@ public class Shelly2ApiRpc extends Shelly2ApiClient implements ShellyApiInterfac
// Pro 3EM has 3 meters
// Pro 2 has 2 relays, but no meters
// Mini PM has 1 meter, but no relay
if (thingType.equals(THING_TYPE_SHELLYPRO2_RELAY_STR)) {
if (thingType.equals(THING_TYPE_SHELLYPRO2_STR)) {
profile.numMeters = 0;
} else if (thingType.equals(THING_TYPE_SHELLYPRO3EM_STR)) {
profile.numMeters = 3;
@@ -224,7 +224,7 @@ public class ShellyThingCreator {
public static final String THING_TYPE_SHELLYPRO1_STR = "shellypro1";
public static final String THING_TYPE_SHELLYPRO1PM_STR = "shellypro1pm";
public static final String THING_TYPE_SHELLYPRO1CB_STR = "shellypro1cb";
public static final String THING_TYPE_SHELLYPRO2_RELAY_STR = "shellypro2-relay";
public static final String THING_TYPE_SHELLYPRO2_STR = "shellypro2";
public static final String THING_TYPE_SHELLYPRO2PM_RELAY_STR = "shellypro2pm-relay";
public static final String THING_TYPE_SHELLYPRO2PM_ROLLER_STR = "shellypro2pm-roller";
public static final String THING_TYPE_SHELLYPRO3_STR = "shellypro3";
@@ -350,8 +350,7 @@ public class ShellyThingCreator {
THING_TYPE_SHELLYPRO1PM_STR);
public static final ThingTypeUID THING_TYPE_SHELLYPRO1CB = new ThingTypeUID(BINDING_ID,
THING_TYPE_SHELLYPRO1CB_STR);
public static final ThingTypeUID THING_TYPE_SHELLYPRO2_RELAY = new ThingTypeUID(BINDING_ID,
THING_TYPE_SHELLYPRO2_RELAY_STR);
public static final ThingTypeUID THING_TYPE_SHELLYPRO2 = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYPRO2_STR);
public static final ThingTypeUID THING_TYPE_SHELLYPRO2PM_RELAY = new ThingTypeUID(BINDING_ID,
THING_TYPE_SHELLYPRO2PM_RELAY_STR);
public static final ThingTypeUID THING_TYPE_SHELLYPRO2PM_ROLLER = new ThingTypeUID(BINDING_ID,
@@ -446,9 +445,8 @@ public class ShellyThingCreator {
Map.entry(SHELLYDT_PRO1PM_2, THING_TYPE_SHELLYPRO1PM),
Map.entry(SHELLYDT_PRO1PM_3, THING_TYPE_SHELLYPRO1PM), //
Map.entry(SHELLYDT_PRO1CB, THING_TYPE_SHELLYPRO1CB), //
Map.entry(SHELLYDT_PRO2, THING_TYPE_SHELLYPRO2_RELAY),
Map.entry(SHELLYDT_PRO2_2, THING_TYPE_SHELLYPRO2_RELAY),
Map.entry(SHELLYDT_PRO2_3, THING_TYPE_SHELLYPRO2_RELAY), //
Map.entry(SHELLYDT_PRO2, THING_TYPE_SHELLYPRO2), Map.entry(SHELLYDT_PRO2_2, THING_TYPE_SHELLYPRO2),
Map.entry(SHELLYDT_PRO2_3, THING_TYPE_SHELLYPRO2), //
Map.entry(SHELLYDT_PRO3, THING_TYPE_SHELLYPRO3), //
Map.entry(SHELLYDT_PROEM50, THING_TYPE_SHELLYPROEM50), //
Map.entry(SHELLYDT_PRO3EM, THING_TYPE_SHELLYPRO3EM), //
@@ -557,7 +555,7 @@ public class ShellyThingCreator {
Map.entry(THING_TYPE_SHELLYPRO1CB_STR, THING_TYPE_SHELLYPRO1CB),
Map.entry(THING_TYPE_SHELLYPRO2PM_RELAY_STR, THING_TYPE_SHELLYPRO2PM_RELAY),
Map.entry(THING_TYPE_SHELLYPRO2PM_ROLLER_STR, THING_TYPE_SHELLYPRO2PM_ROLLER),
Map.entry(THING_TYPE_SHELLYPRO2_RELAY_STR, THING_TYPE_SHELLYPRO2_RELAY),
Map.entry(THING_TYPE_SHELLYPRO2_STR, THING_TYPE_SHELLYPRO2),
Map.entry(THING_TYPE_SHELLYPROEM50_STR, THING_TYPE_SHELLYPROEM50),
Map.entry(THING_TYPE_SHELLYPRO3EM_STR, THING_TYPE_SHELLYPRO3EM),
Map.entry(THING_TYPE_SHELLYPRO3_STR, THING_TYPE_SHELLYPRO3),
@@ -116,7 +116,7 @@ thing-type.shelly.shelly1pmmini.description = Shelly Plus Mini 1PM - Single Rel
thing-type.shelly.shellypro1.description = Shelly Pro 1 - Single Relay Switch
thing-type.shelly.shellypro1pm.description = Shelly Pro 1PM - Single Relay Switch with Power Meter
thing-type.shelly.shellypro1cb.description = Shelly Pro 1CB - Single Circuit Breaker with Voltmeter
thing-type.shelly.shellypro2-relay.description = Shelly Pro 2 - Dual Relay Switch
thing-type.shelly.shellypro2.description = Shelly Pro 2 - Dual Relay Switch
thing-type.shelly.shellypro2pm-relay.description= Shelly Pro 2PM - Dual Relay Switch with Power Meter
thing-type.shelly.shellypro2pm-roller.description = Shelly Pro 2PM - Roller Control with Power Meter
thing-type.shelly.shellypro3.description = Shelly Pro 3 - 3xRelay Switch
@@ -253,9 +253,9 @@
<config-description-ref uri="thing-type:shelly:relay-gen2"/>
</thing-type>
<thing-type id="shellypro2-relay">
<label>ShellyPro 2 Relay</label>
<description>@text/thing-type.shelly.shellypro2-relay.description</description>
<thing-type id="shellypro2">
<label>Shelly Pro 2</label>
<description>@text/thing-type.shelly.shellypro2.description</description>
<semantic-equipment-tag>ControlDevice</semantic-equipment-tag>
<channel-groups>
<channel-group id="relay1" typeId="relayChannel">
@@ -324,9 +324,6 @@
<channel-group id="relay3" typeId="relayChannel">
<label>@text/channel-group-type.shelly.relayChannel3.label</label>
</channel-group>
<channel-group id="relay4" typeId="relayChannel">
<label>@text/channel-group-type.shelly.relayChannel4.label</label>
</channel-group>
<channel-group id="device" typeId="deviceStatus"/>
</channel-groups>
@@ -105,7 +105,7 @@ public class ShellyDeviceProfileTest {
// Shelly Pro
Arguments.of(THING_TYPE_SHELLYPRO1, true, false), //
Arguments.of(THING_TYPE_SHELLYPRO1PM, true, false), //
Arguments.of(THING_TYPE_SHELLYPRO2_RELAY, true, false), //
Arguments.of(THING_TYPE_SHELLYPRO2, true, false), //
Arguments.of(THING_TYPE_SHELLYPRO2PM_RELAY, true, false), //
Arguments.of(THING_TYPE_SHELLYPRO2PM_ROLLER, true, false), //
Arguments.of(THING_TYPE_SHELLYPRO3, true, false), //
@@ -179,9 +179,9 @@ public class ShellyThingCreatorTest {
Arguments.of(SHELLYDT_PRO1PM_2, "", THING_TYPE_SHELLYPRO1PM), //
Arguments.of(SHELLYDT_PRO1PM_3, "", THING_TYPE_SHELLYPRO1PM), //
Arguments.of(SHELLYDT_PRO1CB, "", THING_TYPE_SHELLYPRO1CB), //
Arguments.of("SPSW-002XE16EU", "", THING_TYPE_SHELLYPRO2_RELAY), //
Arguments.of("SPSW-102XE16EU", "", THING_TYPE_SHELLYPRO2_RELAY), //
Arguments.of("SPSW-202XE16EU", "", THING_TYPE_SHELLYPRO2_RELAY), //
Arguments.of(SHELLYDT_PRO2, "", THING_TYPE_SHELLYPRO2), //
Arguments.of(SHELLYDT_PRO2_2, "", THING_TYPE_SHELLYPRO2), //
Arguments.of(SHELLYDT_PRO2_3, "", THING_TYPE_SHELLYPRO2), //
Arguments.of("SPSW-002PE16EU", "relay", THING_TYPE_SHELLYPRO2PM_RELAY), //
Arguments.of("SPSW-102PE16EU", "relay", THING_TYPE_SHELLYPRO2PM_RELAY), //
Arguments.of("SPSW-202PE16EU", "relay", THING_TYPE_SHELLYPRO2PM_RELAY), //
@@ -210,7 +210,7 @@ public class ShellyThingCreatorTest {
void getThingUIDReturnsThingTypeMatchingServiceName() {
Set<ThingTypeUID> excludedThingTypeUids = Set.of(THING_TYPE_SHELLY2_RELAY, THING_TYPE_SHELLY2_ROLLER,
THING_TYPE_SHELLY25_ROLLER, THING_TYPE_SHELLY25_RELAY, THING_TYPE_SHELLYPLUSHTG3,
THING_TYPE_SHELLYPLUS2PM_RELAY, THING_TYPE_SHELLYPLUS2PM_ROLLER, THING_TYPE_SHELLYPRO2_RELAY,
THING_TYPE_SHELLYPLUS2PM_RELAY, THING_TYPE_SHELLYPLUS2PM_ROLLER, THING_TYPE_SHELLYPRO2,
THING_TYPE_SHELLYPRO2PM_ROLLER, THING_TYPE_SHELLYPRO2PM_RELAY, THING_TYPE_SHELLYRGBW2_COLOR);
for (ThingTypeUID supportedThingTypeUid : SUPPORTED_THING_TYPES.stream()