]> git.basschouten.com Git - openhab-addons.git/commitdiff
[rotel] Add support for models M8 and S5 (Michi) (#13060)
authorlolodomo <lg.hc@free.fr>
Sat, 2 Jul 2022 11:31:10 +0000 (13:31 +0200)
committerGitHub <noreply@github.com>
Sat, 2 Jul 2022 11:31:10 +0000 (13:31 +0200)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.rotel/README.md
bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelBindingConstants.java
bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelHandlerFactory.java
bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelModel.java
bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/handler/RotelHandler.java
bundles/org.openhab.binding.rotel/src/main/resources/OH-INF/i18n/rotel.properties
bundles/org.openhab.binding.rotel/src/main/resources/OH-INF/thing/m8.xml [new file with mode: 0644]
bundles/org.openhab.binding.rotel/src/main/resources/OH-INF/thing/s5.xml [new file with mode: 0644]

index ed5fdf9d0d752ce4e5f289b764eb1b6159376867..edc946d4c8ad6c39a748ae9f1c12f2f20c5221bf 100644 (file)
@@ -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                     |
index 611228a5cd0ccae3ad64b85da824d1e9760d4fbd..31319938131411d57c3816da64be7923faebf80a 100644 (file)
@@ -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);
 
index 8485518f5300051aa726fbef950912c6d5ff481e..56b7ecd1fe0f5a086d4d26c9260328001eed36a8 100644 (file)
@@ -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;
index 6eb1c5305e8037ee66162ace262f906eb7d0dcc2..38bf2063d11cbfd50c29499755aeb1c788532698 100644 (file)
@@ -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);
 
index 4a383e7f0ef754478cee50a380f1688371e6f9ab..11dca6205962bd203f7e9be41b03a237b86cc21f 100644 (file)
@@ -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;
index 8378a5c352b75228578674b93554969f8ab28f55..6308b2ce9df4fb86ef60a93fb4eff85c6cb4e605 100644 (file)
@@ -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 (file)
index 0000000..c60f2a7
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<thing:thing-descriptions bindingId="rotel"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
+       xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
+
+       <!-- Rotel M8 Connection Thing Type -->
+       <thing-type id="m8">
+               <label>M8 Monoblock Amplifier</label>
+               <description>Connection to the Rotel Michi M8 monoblock amplifier</description>
+
+               <channels>
+                       <channel id="power" typeId="system.power"/>
+                       <channel id="brightness" typeId="brightness"/>
+               </channels>
+
+               <properties>
+                       <property name="protocol">ASCII_V2</property>
+               </properties>
+
+               <config-description-ref uri="thing-type:rotel:serialandip"/>
+       </thing-type>
+
+</thing:thing-descriptions>
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 (file)
index 0000000..9942843
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<thing:thing-descriptions bindingId="rotel"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
+       xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
+
+       <!-- Rotel S5 Connection Thing Type -->
+       <thing-type id="s5">
+               <label>S5 Stereo Amplifier</label>
+               <description>Connection to the Rotel Michi S5 stereo amplifier</description>
+
+               <channels>
+                       <channel id="power" typeId="system.power"/>
+                       <channel id="brightness" typeId="brightness"/>
+               </channels>
+
+               <properties>
+                       <property name="protocol">ASCII_V2</property>
+               </properties>
+
+               <config-description-ref uri="thing-type:rotel:serialandip"/>
+       </thing-type>
+
+</thing:thing-descriptions>