[avmfritz] Pimp properties and channel types with proper categories (#9514)

* Pimp channel types with proper categories

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
Christoph Weitkamp 2020-12-26 09:33:01 +01:00 committed by GitHub
parent 291b30955b
commit 3533001bd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 18 deletions

View File

@ -87,6 +87,7 @@ public class AVMFritzBindingConstants {
// List of all Properties
public static final String PROPERTY_MASTER = "master";
public static final String PROPERTY_MEMBERS = "members";
public static final String PRODUCT_NAME = "productName";
// List of all channel groups
public static final String CHANNEL_GROUP_SENSORS = "sensors";

View File

@ -127,7 +127,7 @@ public class AVMFritzDiscoveryService extends AbstractDiscoveryService
Map<String, Object> properties = new HashMap<>();
properties.put(CONFIG_AIN, device.getIdentifier());
properties.put(PROPERTY_VENDOR, device.getManufacturer());
properties.put(PROPERTY_MODEL_ID, device.getDeviceId());
properties.put(PRODUCT_NAME, device.getProductName());
properties.put(PROPERTY_SERIAL_NUMBER, device.getIdentifier());
properties.put(PROPERTY_FIRMWARE_VERSION, device.getFirmwareVersion());
if (device instanceof GroupModel && ((GroupModel) device).getGroupinfo() != null) {

View File

@ -61,7 +61,7 @@
<item-type>Contact</item-type>
<label>Device Locked (external)</label>
<description>Device is locked for switching over external sources.</description>
<category>Contact</category>
<category>Lock</category>
<state pattern="%s" readOnly="true"/>
</channel-type>
@ -69,7 +69,7 @@
<item-type>Contact</item-type>
<label>Locked (manual)</label>
<description>Device is locked for switching by pressing the button on the device.</description>
<category>Contact</category>
<category>Lock</category>
<state pattern="%s" readOnly="true"/>
</channel-type>
@ -163,7 +163,7 @@
<item-type>Number:Temperature</item-type>
<label>Setpoint Temperature</label>
<description>Thermostat Setpoint temperature.</description>
<category>Temperature</category>
<category>Heating</category>
<state pattern="%.1f %unit%"/>
</channel-type>
@ -187,6 +187,7 @@
<item-type>String</item-type>
<label>Radiator Mode</label>
<description>States the mode of the radiator (ON/OFF/COMFORT/ECO/BOOST/WINDOW_OPEN).</description>
<category>Heating</category>
<state pattern="%s">
<options>
<option value="ON">On</option>

View File

@ -165,7 +165,7 @@ public class AVMFritzDiscoveryServiceOSGiTest extends AVMFritzThingHandlerOSGiTe
assertEquals(BRIGE_THING_ID, discoveryResult.getBridgeUID());
assertEquals("087610954669", discoveryResult.getProperties().get(CONFIG_AIN));
assertEquals("AVM", discoveryResult.getProperties().get(PROPERTY_VENDOR));
assertEquals("20", discoveryResult.getProperties().get(PROPERTY_MODEL_ID));
assertEquals("FRITZ!DECT Repeater 100", discoveryResult.getProperties().get(PRODUCT_NAME));
assertEquals("087610954669", discoveryResult.getProperties().get(PROPERTY_SERIAL_NUMBER));
assertEquals("03.86", discoveryResult.getProperties().get(PROPERTY_FIRMWARE_VERSION));
assertEquals(CONFIG_AIN, discoveryResult.getRepresentationProperty());
@ -227,7 +227,7 @@ public class AVMFritzDiscoveryServiceOSGiTest extends AVMFritzThingHandlerOSGiTe
assertEquals(BRIGE_THING_ID, discoveryResult.getBridgeUID());
assertEquals("087610000434", discoveryResult.getProperties().get(CONFIG_AIN));
assertEquals("AVM", discoveryResult.getProperties().get(PROPERTY_VENDOR));
assertEquals("17", discoveryResult.getProperties().get(PROPERTY_MODEL_ID));
assertEquals("FRITZ!DECT 200", discoveryResult.getProperties().get(PRODUCT_NAME));
assertEquals("087610000434", discoveryResult.getProperties().get(PROPERTY_SERIAL_NUMBER));
assertEquals("03.83", discoveryResult.getProperties().get(PROPERTY_FIRMWARE_VERSION));
assertEquals(CONFIG_AIN, discoveryResult.getRepresentationProperty());
@ -277,7 +277,7 @@ public class AVMFritzDiscoveryServiceOSGiTest extends AVMFritzThingHandlerOSGiTe
assertEquals(BRIGE_THING_ID, discoveryResult.getBridgeUID());
assertEquals("087610000434", discoveryResult.getProperties().get(CONFIG_AIN));
assertEquals("AVM", discoveryResult.getProperties().get(PROPERTY_VENDOR));
assertEquals("17", discoveryResult.getProperties().get(PROPERTY_MODEL_ID));
assertEquals("FRITZ!DECT 210", discoveryResult.getProperties().get(PRODUCT_NAME));
assertEquals("087610000434", discoveryResult.getProperties().get(PROPERTY_SERIAL_NUMBER));
assertEquals("03.83", discoveryResult.getProperties().get(PROPERTY_FIRMWARE_VERSION));
assertEquals(CONFIG_AIN, discoveryResult.getRepresentationProperty());
@ -330,7 +330,7 @@ public class AVMFritzDiscoveryServiceOSGiTest extends AVMFritzThingHandlerOSGiTe
assertEquals(BRIGE_THING_ID, discoveryResult.getBridgeUID());
assertEquals("087610000435", discoveryResult.getProperties().get(CONFIG_AIN));
assertEquals("AVM", discoveryResult.getProperties().get(PROPERTY_VENDOR));
assertEquals("18", discoveryResult.getProperties().get(PROPERTY_MODEL_ID));
assertEquals("Comet DECT", discoveryResult.getProperties().get(PRODUCT_NAME));
assertEquals("087610000435", discoveryResult.getProperties().get(PROPERTY_SERIAL_NUMBER));
assertEquals("03.50", discoveryResult.getProperties().get(PROPERTY_FIRMWARE_VERSION));
assertEquals(CONFIG_AIN, discoveryResult.getRepresentationProperty());
@ -383,7 +383,7 @@ public class AVMFritzDiscoveryServiceOSGiTest extends AVMFritzThingHandlerOSGiTe
assertEquals(BRIGE_THING_ID, discoveryResult.getBridgeUID());
assertEquals("087610000435", discoveryResult.getProperties().get(CONFIG_AIN));
assertEquals("AVM", discoveryResult.getProperties().get(PROPERTY_VENDOR));
assertEquals("18", discoveryResult.getProperties().get(PROPERTY_MODEL_ID));
assertEquals("FRITZ!DECT 300", discoveryResult.getProperties().get(PRODUCT_NAME));
assertEquals("087610000435", discoveryResult.getProperties().get(PROPERTY_SERIAL_NUMBER));
assertEquals("03.50", discoveryResult.getProperties().get(PROPERTY_FIRMWARE_VERSION));
assertEquals(CONFIG_AIN, discoveryResult.getRepresentationProperty());
@ -436,7 +436,7 @@ public class AVMFritzDiscoveryServiceOSGiTest extends AVMFritzThingHandlerOSGiTe
assertEquals(BRIGE_THING_ID, discoveryResult.getBridgeUID());
assertEquals("087610000435", discoveryResult.getProperties().get(CONFIG_AIN));
assertEquals("AVM", discoveryResult.getProperties().get(PROPERTY_VENDOR));
assertEquals("18", discoveryResult.getProperties().get(PROPERTY_MODEL_ID));
assertEquals("FRITZ!DECT 301", discoveryResult.getProperties().get(PRODUCT_NAME));
assertEquals("087610000435", discoveryResult.getProperties().get(PROPERTY_SERIAL_NUMBER));
assertEquals("03.50", discoveryResult.getProperties().get(PROPERTY_FIRMWARE_VERSION));
assertEquals(CONFIG_AIN, discoveryResult.getRepresentationProperty());
@ -482,7 +482,7 @@ public class AVMFritzDiscoveryServiceOSGiTest extends AVMFritzThingHandlerOSGiTe
assertEquals(BRIGE_THING_ID, discoveryResult.getBridgeUID());
assertEquals("5C:49:79:F0:A3:84", discoveryResult.getProperties().get(CONFIG_AIN));
assertEquals("AVM", discoveryResult.getProperties().get(PROPERTY_VENDOR));
assertEquals("19", discoveryResult.getProperties().get(PROPERTY_MODEL_ID));
assertEquals("FRITZ!Powerline 546E", discoveryResult.getProperties().get(PRODUCT_NAME));
assertEquals("5C:49:79:F0:A3:84", discoveryResult.getProperties().get(PROPERTY_SERIAL_NUMBER));
assertEquals("06.92", discoveryResult.getProperties().get(PROPERTY_FIRMWARE_VERSION));
assertEquals(CONFIG_AIN, discoveryResult.getRepresentationProperty());
@ -549,7 +549,7 @@ public class AVMFritzDiscoveryServiceOSGiTest extends AVMFritzThingHandlerOSGiTe
assertEquals(BRIGE_THING_ID, discoveryResult.getBridgeUID());
assertEquals("119340059578-1", discoveryResult.getProperties().get(CONFIG_AIN));
assertEquals("0x0feb", discoveryResult.getProperties().get(PROPERTY_VENDOR));
assertEquals("2000", discoveryResult.getProperties().get(PROPERTY_MODEL_ID));
assertEquals("HAN-FUN", discoveryResult.getProperties().get(PRODUCT_NAME));
assertEquals("119340059578-1", discoveryResult.getProperties().get(PROPERTY_SERIAL_NUMBER));
assertEquals("0.0", discoveryResult.getProperties().get(PROPERTY_FIRMWARE_VERSION));
assertEquals(CONFIG_AIN, discoveryResult.getRepresentationProperty());
@ -592,7 +592,7 @@ public class AVMFritzDiscoveryServiceOSGiTest extends AVMFritzThingHandlerOSGiTe
assertEquals(BRIGE_THING_ID, discoveryResult.getBridgeUID());
assertEquals("119340059578-1", discoveryResult.getProperties().get(CONFIG_AIN));
assertEquals("0x0feb", discoveryResult.getProperties().get(PROPERTY_VENDOR));
assertEquals("2001", discoveryResult.getProperties().get(PROPERTY_MODEL_ID));
assertEquals("HAN-FUN", discoveryResult.getProperties().get(PRODUCT_NAME));
assertEquals("119340059578-1", discoveryResult.getProperties().get(PROPERTY_SERIAL_NUMBER));
assertEquals("0.0", discoveryResult.getProperties().get(PROPERTY_FIRMWARE_VERSION));
assertEquals(CONFIG_AIN, discoveryResult.getRepresentationProperty());
@ -635,7 +635,7 @@ public class AVMFritzDiscoveryServiceOSGiTest extends AVMFritzThingHandlerOSGiTe
assertEquals(BRIGE_THING_ID, discoveryResult.getBridgeUID());
assertEquals("119340059578-1", discoveryResult.getProperties().get(CONFIG_AIN));
assertEquals("0x0feb", discoveryResult.getProperties().get(PROPERTY_VENDOR));
assertEquals("2002", discoveryResult.getProperties().get(PROPERTY_MODEL_ID));
assertEquals("HAN-FUN", discoveryResult.getProperties().get(PRODUCT_NAME));
assertEquals("119340059578-1", discoveryResult.getProperties().get(PROPERTY_SERIAL_NUMBER));
assertEquals("0.0", discoveryResult.getProperties().get(PROPERTY_FIRMWARE_VERSION));
assertEquals(CONFIG_AIN, discoveryResult.getRepresentationProperty());
@ -678,7 +678,7 @@ public class AVMFritzDiscoveryServiceOSGiTest extends AVMFritzThingHandlerOSGiTe
assertEquals(BRIGE_THING_ID, discoveryResult.getBridgeUID());
assertEquals("113240059952-1", discoveryResult.getProperties().get(CONFIG_AIN));
assertEquals("0x2c3c", discoveryResult.getProperties().get(PROPERTY_VENDOR));
assertEquals("2003", discoveryResult.getProperties().get(PROPERTY_MODEL_ID));
assertEquals("HAN-FUN", discoveryResult.getProperties().get(PRODUCT_NAME));
assertEquals("113240059952-1", discoveryResult.getProperties().get(PROPERTY_SERIAL_NUMBER));
assertEquals("0.0", discoveryResult.getProperties().get(PROPERTY_FIRMWARE_VERSION));
assertEquals(CONFIG_AIN, discoveryResult.getRepresentationProperty());
@ -721,7 +721,7 @@ public class AVMFritzDiscoveryServiceOSGiTest extends AVMFritzThingHandlerOSGiTe
assertEquals(BRIGE_THING_ID, discoveryResult.getBridgeUID());
assertEquals("119340059578-1", discoveryResult.getProperties().get(CONFIG_AIN));
assertEquals("0x0feb", discoveryResult.getProperties().get(PROPERTY_VENDOR));
assertEquals("2001", discoveryResult.getProperties().get(PROPERTY_MODEL_ID));
assertEquals("HAN-FUN", discoveryResult.getProperties().get(PRODUCT_NAME));
assertEquals("119340059578-1", discoveryResult.getProperties().get(PROPERTY_SERIAL_NUMBER));
assertEquals("0.0", discoveryResult.getProperties().get(PROPERTY_FIRMWARE_VERSION));
assertEquals(CONFIG_AIN, discoveryResult.getRepresentationProperty());
@ -778,7 +778,7 @@ public class AVMFritzDiscoveryServiceOSGiTest extends AVMFritzThingHandlerOSGiTe
assertEquals(BRIGE_THING_ID, discoveryResult.getBridgeUID());
assertEquals("F0:A3:7F-900", discoveryResult.getProperties().get(CONFIG_AIN));
assertEquals("AVM", discoveryResult.getProperties().get(PROPERTY_VENDOR));
assertEquals("20000", discoveryResult.getProperties().get(PROPERTY_MODEL_ID));
assertEquals("", discoveryResult.getProperties().get(PRODUCT_NAME));
assertEquals("F0:A3:7F-900", discoveryResult.getProperties().get(PROPERTY_SERIAL_NUMBER));
assertEquals("1.0", discoveryResult.getProperties().get(PROPERTY_FIRMWARE_VERSION));
assertEquals("1000", discoveryResult.getProperties().get(PROPERTY_MASTER));
@ -830,7 +830,7 @@ public class AVMFritzDiscoveryServiceOSGiTest extends AVMFritzThingHandlerOSGiTe
assertEquals(BRIGE_THING_ID, discoveryResult.getBridgeUID());
assertEquals("F0:A3:7F-900", discoveryResult.getProperties().get(CONFIG_AIN));
assertEquals("AVM", discoveryResult.getProperties().get(PROPERTY_VENDOR));
assertEquals("20001", discoveryResult.getProperties().get(PROPERTY_MODEL_ID));
assertEquals("", discoveryResult.getProperties().get(PRODUCT_NAME));
assertEquals("F0:A3:7F-900", discoveryResult.getProperties().get(PROPERTY_SERIAL_NUMBER));
assertEquals("1.0", discoveryResult.getProperties().get(PROPERTY_FIRMWARE_VERSION));
assertEquals("1000", discoveryResult.getProperties().get(PROPERTY_MASTER));