From 03d37232c35de0d045a2ee4d9e34f7586f9035b6 Mon Sep 17 00:00:00 2001 From: lolodomo Date: Sat, 2 Jul 2022 13:31:10 +0200 Subject: [PATCH] [rotel] Add support for models M8 and S5 (Michi) (#13060) Signed-off-by: Laurent Garnier --- bundles/org.openhab.binding.rotel/README.md | 4 ++++ .../rotel/internal/RotelBindingConstants.java | 4 ++++ .../rotel/internal/RotelHandlerFactory.java | 4 ++-- .../binding/rotel/internal/RotelModel.java | 2 ++ .../rotel/internal/handler/RotelHandler.java | 6 +++++ .../resources/OH-INF/i18n/rotel.properties | 4 ++++ .../src/main/resources/OH-INF/thing/m8.xml | 24 +++++++++++++++++++ .../src/main/resources/OH-INF/thing/s5.xml | 24 +++++++++++++++++++ 8 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 bundles/org.openhab.binding.rotel/src/main/resources/OH-INF/thing/m8.xml create mode 100644 bundles/org.openhab.binding.rotel/src/main/resources/OH-INF/thing/s5.xml diff --git a/bundles/org.openhab.binding.rotel/README.md b/bundles/org.openhab.binding.rotel/README.md index ed5fdf9d0..edc946d4c 100644 --- a/bundles/org.openhab.binding.rotel/README.md +++ b/bundles/org.openhab.binding.rotel/README.md @@ -35,6 +35,7 @@ This binding supports the following thing types: | a14 | Connection to the Rotel A14 or A14MKII integrated amplifier | | cd11 | Connection to the Rotel CD11 CD player | | cd14 | Connection to the Rotel CD14 or CD14MKII CD player | +| m8 | Connection to the Rotel Michi M8 monoblock amplifier | | p5 | Connection to the Rotel Michi P5 stereo preamplifier | | ra11 | Connection to the Rotel RA-11 integrated amplifier | | ra12 | Connection to the Rotel RA-12 integrated amplifier | @@ -70,6 +71,7 @@ This binding supports the following thing types: | rt09 | Connection to the Rotel RT-09 tuner | | rt11 | Connection to the Rotel RT-11 tuner | | rt1570 | Connection to the Rotel RT-1570 tuner | +| s5 | Connection to the Rotel Michi S5 stereo amplifier | | t11 | Connection to the Rotel T11 tuner | | t14 | Connection to the Rotel T14 tuner | | x3 | Connection to the Rotel Michi X3 integrated amplifier | @@ -179,6 +181,7 @@ Here are the list of channels available for each thing type: | a14 | power, source, volume, mute, bass, treble, frequency, brightness, tcbypass, balance, speakera, speakerb | | cd11 | power, playControl, track, brightness | | cd14 | power, playControl, track, brightness | +| m8 | power, brightness | | p5 | power, source, volume, mute, bass, treble, frequency, brightness, tcbypass, balance | | ra11 | power, source, volume, mute, bass, treble, playControl, frequency, brightness, tcbypass, balance | | ra12 | power, source, volume, mute, bass, treble, playControl, frequency, brightness, tcbypass, balance | @@ -214,6 +217,7 @@ Here are the list of channels available for each thing type: | rt09 | power, source, playControl, brightness | | rt11 | power, source, brightness | | rt1570 | power, source, brightness | +| s5 | power, brightness | | t11 | power, source, brightness | | t14 | power, source, brightness | | x3 | power, source, volume, mute, bass, treble, frequency, brightness, tcbypass, balance | diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelBindingConstants.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelBindingConstants.java index 611228a5c..313199381 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelBindingConstants.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelBindingConstants.java @@ -68,7 +68,9 @@ public class RotelBindingConstants { public static final String THING_TYPE_ID_RT1570 = "rt1570"; public static final String THING_TYPE_ID_T11 = "t11"; public static final String THING_TYPE_ID_T14 = "t14"; + public static final String THING_TYPE_ID_M8 = "m8"; public static final String THING_TYPE_ID_P5 = "p5"; + public static final String THING_TYPE_ID_S5 = "s5"; public static final String THING_TYPE_ID_X3 = "x3"; public static final String THING_TYPE_ID_X5 = "x5"; @@ -114,7 +116,9 @@ public class RotelBindingConstants { public static final ThingTypeUID THING_TYPE_RT1570 = new ThingTypeUID(BINDING_ID, THING_TYPE_ID_RT1570); public static final ThingTypeUID THING_TYPE_T11 = new ThingTypeUID(BINDING_ID, THING_TYPE_ID_T11); public static final ThingTypeUID THING_TYPE_T14 = new ThingTypeUID(BINDING_ID, THING_TYPE_ID_T14); + public static final ThingTypeUID THING_TYPE_M8 = new ThingTypeUID(BINDING_ID, THING_TYPE_ID_M8); public static final ThingTypeUID THING_TYPE_P5 = new ThingTypeUID(BINDING_ID, THING_TYPE_ID_P5); + public static final ThingTypeUID THING_TYPE_S5 = new ThingTypeUID(BINDING_ID, THING_TYPE_ID_S5); public static final ThingTypeUID THING_TYPE_X3 = new ThingTypeUID(BINDING_ID, THING_TYPE_ID_X3); public static final ThingTypeUID THING_TYPE_X5 = new ThingTypeUID(BINDING_ID, THING_TYPE_ID_X5); diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelHandlerFactory.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelHandlerFactory.java index 8485518f5..56b7ecd1f 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelHandlerFactory.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelHandlerFactory.java @@ -50,8 +50,8 @@ public class RotelHandlerFactory extends BaseThingHandlerFactory { THING_TYPE_RA12, THING_TYPE_RA1570, THING_TYPE_RA1572, THING_TYPE_RA1592, THING_TYPE_RAP1580, THING_TYPE_RC1570, THING_TYPE_RC1572, THING_TYPE_RC1590, THING_TYPE_RCD1570, THING_TYPE_RCD1572, THING_TYPE_RCX1500, THING_TYPE_RDD1580, THING_TYPE_RDG1520, THING_TYPE_RSP1576, THING_TYPE_RSP1582, - THING_TYPE_RT09, THING_TYPE_RT11, THING_TYPE_RT1570, THING_TYPE_T11, THING_TYPE_T14, THING_TYPE_P5, - THING_TYPE_X3, THING_TYPE_X5) + THING_TYPE_RT09, THING_TYPE_RT11, THING_TYPE_RT1570, THING_TYPE_T11, THING_TYPE_T14, THING_TYPE_M8, + THING_TYPE_P5, THING_TYPE_S5, THING_TYPE_X3, THING_TYPE_X5) .collect(Collectors.toSet())); private final SerialPortManager serialPortManager; diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelModel.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelModel.java index 6eb1c5305..38bf2063d 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelModel.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelModel.java @@ -89,7 +89,9 @@ public enum RotelModel { RT1570("RT-1570", 115200, 14, null, false, null, false, -1, false, true, 6, 0, NO_SPECIAL_CHARACTERS), T11("T11", 115200, 12, null, false, null, false, -1, false, true, 6, 0, NO_SPECIAL_CHARACTERS), T14("T14", 115200, 13, null, false, null, false, -1, false, true, 6, 0, NO_SPECIAL_CHARACTERS), + M8("M8", 115200, 0, null, false, null, false, -1, false, true, 4, 0, NO_SPECIAL_CHARACTERS), P5("P5", 115200, 20, 96, true, 10, 10, false, -1, true, false, true, 4, 0, NO_SPECIAL_CHARACTERS), + S5("S5", 115200, 0, null, false, null, false, -1, false, true, 4, 0, NO_SPECIAL_CHARACTERS), X3("X3", 115200, 18, 96, true, 10, 10, false, -1, true, false, true, 4, 0, NO_SPECIAL_CHARACTERS), X5("X5", 115200, 19, 96, true, 10, 10, false, -1, true, false, true, 4, 0, NO_SPECIAL_CHARACTERS); diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/handler/RotelHandler.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/handler/RotelHandler.java index 4a383e7f0..11dca6205 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/handler/RotelHandler.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/handler/RotelHandler.java @@ -281,9 +281,15 @@ public class RotelHandler extends BaseThingHandler implements RotelMessageEventL case THING_TYPE_ID_T14: model = RotelModel.T14; break; + case THING_TYPE_ID_M8: + model = RotelModel.M8; + break; case THING_TYPE_ID_P5: model = RotelModel.P5; break; + case THING_TYPE_ID_S5: + model = RotelModel.S5; + break; case THING_TYPE_ID_X3: model = RotelModel.X3; break; diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/OH-INF/i18n/rotel.properties b/bundles/org.openhab.binding.rotel/src/main/resources/OH-INF/i18n/rotel.properties index 8378a5c35..6308b2ce9 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/OH-INF/i18n/rotel.properties +++ b/bundles/org.openhab.binding.rotel/src/main/resources/OH-INF/i18n/rotel.properties @@ -15,6 +15,8 @@ thing-type.rotel.cd11.label = CD11 CD Player thing-type.rotel.cd11.description = Connection to the Rotel CD11 CD player thing-type.rotel.cd14.label = CD14 CD Player thing-type.rotel.cd14.description = Connection to the Rotel CD14 or CD14MKII CD player +thing-type.rotel.m8.label = M8 Monoblock Amplifier +thing-type.rotel.m8.description = Connection to the Rotel Michi M8 monoblock amplifier thing-type.rotel.p5.label = P5 Stereo Preamplifier thing-type.rotel.p5.description = Connection to the Rotel Michi P5 stereo preamplifier thing-type.rotel.ra11.label = RA-11 Integrated Amplifier @@ -85,6 +87,8 @@ thing-type.rotel.rt11.label = RT-11 Tuner thing-type.rotel.rt11.description = Connection to the Rotel RT-11 tuner thing-type.rotel.rt1570.label = RT-1570 Tuner thing-type.rotel.rt1570.description = Connection to the Rotel RT-1570 tuner +thing-type.rotel.s5.label = S5 Stereo Amplifier +thing-type.rotel.s5.description = Connection to the Rotel Michi S5 stereo amplifier thing-type.rotel.t11.label = T11 Tuner thing-type.rotel.t11.description = Connection to the Rotel T11 tuner thing-type.rotel.t14.label = T14 Tuner diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/OH-INF/thing/m8.xml b/bundles/org.openhab.binding.rotel/src/main/resources/OH-INF/thing/m8.xml new file mode 100644 index 000000000..c60f2a734 --- /dev/null +++ b/bundles/org.openhab.binding.rotel/src/main/resources/OH-INF/thing/m8.xml @@ -0,0 +1,24 @@ + + + + + + + Connection to the Rotel Michi M8 monoblock amplifier + + + + + + + + ASCII_V2 + + + + + + diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/OH-INF/thing/s5.xml b/bundles/org.openhab.binding.rotel/src/main/resources/OH-INF/thing/s5.xml new file mode 100644 index 000000000..9942843a9 --- /dev/null +++ b/bundles/org.openhab.binding.rotel/src/main/resources/OH-INF/thing/s5.xml @@ -0,0 +1,24 @@ + + + + + + + Connection to the Rotel Michi S5 stereo amplifier + + + + + + + + ASCII_V2 + + + + + +