Skip to content

Commit b5cc9c5

Browse files
janstenpicklea1aw
janstenpickle
authored andcommitted
Add support for Mini 3
- add new device code and description in `BLDevice`
1 parent a6b6cd7 commit b5cc9c5

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

src/main/java/com/github/mob41/blapi/BLDevice.java

+23-15
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ public abstract class BLDevice implements Closeable {
108108

109109
public static final short DEV_RM_MINI = 0x2737;
110110

111+
public static final short DEV_RM_MINI_3 = 0x27c2;
112+
111113
public static final short DEV_RM_PRO_PHICOMM = 0x273d;
112114

113115
public static final short DEV_RM_2_HOME_PLUS = 0x2783;
@@ -126,10 +128,10 @@ public abstract class BLDevice implements Closeable {
126128

127129
public static final short DEV_MP1 = 0x4EB5;
128130

129-
public static final short DEV_HYSEN = 0x4EAD;
130-
131-
public static final short DEV_FLOUREON = 0xffffffad;
132-
131+
public static final short DEV_HYSEN = 0x4EAD;
132+
133+
public static final short DEV_FLOUREON = 0xffffffad;
134+
133135
//
134136
// Friendly device description
135137
//
@@ -146,6 +148,8 @@ public abstract class BLDevice implements Closeable {
146148

147149
public static final String DESC_RM_MINI = "RM Mini";
148150

151+
public static final String DESC_RM_MINI_3 = "RM Mini 3";
152+
149153
public static final String DESC_RM_PRO_PHICOMM = "RM Pro";
150154

151155
public static final String DESC_RM_2_HOME_PLUS = "RM 2 Home Plus";
@@ -194,9 +198,9 @@ public abstract class BLDevice implements Closeable {
194198

195199
public static final String DESC_SPMINI_PLUS = "Smart Plug Mini Plus";
196200

197-
public static final String DESC_HYSEN = "Hysen Thermostat";
198-
199-
public static final String DESC_FLOUREON = "Floureon Thermostat";
201+
public static final String DESC_HYSEN = "Hysen Thermostat";
202+
203+
public static final String DESC_FLOUREON = "Floureon Thermostat";
200204
/**
201205
* The destination port for discovery broadcasting (from __init__.py)
202206
*/
@@ -562,6 +566,8 @@ public static BLDevice createInstance(short deviceType, String host, Mac mac) th
562566
return new SP2Device(deviceType, desc, host, mac);
563567
case DEV_RM_2:
564568
case DEV_RM_MINI:
569+
case DEV_RM_MINI_3:
570+
return new RM2Device(deviceType, desc, host, mac);
565571
case DEV_RM_PRO_PHICOMM:
566572
case DEV_RM_2_HOME_PLUS:
567573
case DEV_RM_2_2HOME_PLUS_GDT:
@@ -574,10 +580,10 @@ public static BLDevice createInstance(short deviceType, String host, Mac mac) th
574580
return new A1Device(host, mac);
575581
case DEV_MP1:
576582
return new MP1Device(host, mac);
577-
case DEV_FLOUREON:
578-
return new FloureonDevice(host, mac);
579-
case DEV_HYSEN:
580-
return new HysenDevice(host, mac);
583+
case DEV_FLOUREON:
584+
return new FloureonDevice(host, mac);
585+
case DEV_HYSEN:
586+
return new HysenDevice(host, mac);
581587
}
582588
return null;
583589
}
@@ -760,6 +766,8 @@ public static String getDescOfType(short devType){
760766
return DESC_RM_2;
761767
case BLDevice.DEV_RM_MINI:
762768
return DESC_RM_MINI;
769+
case BLDevice.DEV_RM_MINI_3:
770+
return DESC_RM_MINI_3;
763771
case BLDevice.DEV_RM_PRO_PHICOMM:
764772
return DESC_RM_PRO_PHICOMM;
765773
case BLDevice.DEV_RM_2_HOME_PLUS:
@@ -808,10 +816,10 @@ public static String getDescOfType(short devType){
808816
return BLDevice.DESC_MP1;
809817
case BLDevice.DEV_A1:
810818
return BLDevice.DESC_A1;
811-
case BLDevice.DEV_HYSEN:
812-
return BLDevice.DESC_HYSEN;
813-
case BLDevice.DEV_FLOUREON:
814-
return BLDevice.DESC_FLOUREON;
819+
case BLDevice.DEV_HYSEN:
820+
return BLDevice.DESC_HYSEN;
821+
case BLDevice.DEV_FLOUREON:
822+
return BLDevice.DESC_FLOUREON;
815823
//
816824
// Unregonized
817825
//

src/test/java/com/github/mob41/blapi/DevicesTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public void testDevices() throws Exception {
8686
break;
8787
case BLDevice.DEV_RM_2:
8888
case BLDevice.DEV_RM_MINI:
89+
case BLDevice.DEV_RM_MINI_3:
8990
case BLDevice.DEV_RM_PRO_PHICOMM:
9091
case BLDevice.DEV_RM_2_HOME_PLUS:
9192
case BLDevice.DEV_RM_2_2HOME_PLUS_GDT:

0 commit comments

Comments
 (0)