]> git.basschouten.com Git - openhab-addons.git/commitdiff
[wemo] Fix already configured devices in inbox (#12215)
authorJacob Laursen <jacob-github@vindvejr.dk>
Sun, 6 Feb 2022 08:50:29 +0000 (09:50 +0100)
committerGitHub <noreply@github.com>
Sun, 6 Feb 2022 08:50:29 +0000 (09:50 +0100)
* Reuse UDN configuration parameter definition.
* Fix inbox entries for already configured devices.

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
bundles/org.openhab.binding.wemo/src/main/resources/OH-INF/config/config.xml [new file with mode: 0644]
bundles/org.openhab.binding.wemo/src/main/resources/OH-INF/i18n/wemo.properties
bundles/org.openhab.binding.wemo/src/main/resources/OH-INF/thing/thing-types.xml

diff --git a/bundles/org.openhab.binding.wemo/src/main/resources/OH-INF/config/config.xml b/bundles/org.openhab.binding.wemo/src/main/resources/OH-INF/config/config.xml
new file mode 100644 (file)
index 0000000..257d736
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<config-description:config-descriptions
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0"
+       xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0
+               https://openhab.org/schemas/config-description-1.0.0.xsd">
+
+       <config-description uri="thing-type:wemo:device">
+               <parameter name="udn" type="text" required="true">
+                       <label>Unique Device Name</label>
+                       <description>The UDN identifies the WeMo Device</description>
+               </parameter>
+       </config-description>
+
+</config-description:config-descriptions>
index 62e0ef550626b8ed630a03215cea695f06c897fa..a423beb6ebe341ce7bb543add77b476da8bc494a 100644 (file)
@@ -32,20 +32,10 @@ thing-type.config.wemo.CoffeeMaker.udn.label = Unique Device Name
 thing-type.config.wemo.CoffeeMaker.udn.description = The UDN identifies the WeMo Device
 thing-type.config.wemo.MZ100.deviceID.label = Device ID
 thing-type.config.wemo.MZ100.deviceID.description = The device ID identifies one certain WeMo light.
-thing-type.config.wemo.Maker.udn.label = Unique Device Name
-thing-type.config.wemo.Maker.udn.description = The UDN identifies the WeMo Device
 thing-type.config.wemo.bridge.udn.label = Unique Device Name
 thing-type.config.wemo.bridge.udn.description = The UDN identifies the WeMo Link Device
-thing-type.config.wemo.dimmer.udn.label = Unique Device Name
-thing-type.config.wemo.dimmer.udn.description = The UDN identifies the WeMo Device
-thing-type.config.wemo.insight.udn.label = Unique Device Name
-thing-type.config.wemo.insight.udn.description = The UDN identifies the WeMo Device
-thing-type.config.wemo.lightswitch.udn.label = Unique Device Name
-thing-type.config.wemo.lightswitch.udn.description = The UDN identifies the WeMo Device
-thing-type.config.wemo.motion.udn.label = Unique Device Name
-thing-type.config.wemo.motion.udn.description = The UDN identifies the WeMo Device
-thing-type.config.wemo.socket.udn.label = Unique Device Name
-thing-type.config.wemo.socket.udn.description = The UDN identifies the WeMo Device
+thing-type.config.wemo.device.udn.label = Unique Device Name
+thing-type.config.wemo.device.udn.description = The UDN identifies the WeMo Device
 
 # channel types
 
index 91e749948123c059fb3e5e933e449f1d6f4203a2..12ef8a10a71d273ae528182a69528c2395d59536 100644 (file)
                        <channel id="state" typeId="state"/>
                </channels>
 
-               <config-description>
-                       <parameter name="udn" type="text" required="true">
-                               <label>Unique Device Name</label>
-                               <description>The UDN identifies the WeMo Device</description>
-                       </parameter>
-               </config-description>
+               <representation-property>udn</representation-property>
+
+               <config-description-ref uri="thing-type:wemo:device"/>
        </thing-type>
 
        <thing-type id="insight">
                        <channel id="energyTotal" typeId="energyTotal"/>
                        <channel id="standByLimit" typeId="standByLimit"/>
                        <channel id="onStandBy" typeId="onStandBy"/>
-
                </channels>
 
-               <config-description>
-                       <parameter name="udn" type="text" required="true">
-                               <label>Unique Device Name</label>
-                               <description>The UDN identifies the WeMo Device</description>
-                       </parameter>
-               </config-description>
+               <representation-property>udn</representation-property>
+
+               <config-description-ref uri="thing-type:wemo:device"/>
        </thing-type>
 
        <thing-type id="lightswitch">
                        <channel id="state" typeId="state"/>
                </channels>
 
-               <config-description>
-                       <parameter name="udn" type="text" required="true">
-                               <label>Unique Device Name</label>
-                               <description>The UDN identifies the WeMo Device</description>
-                       </parameter>
-               </config-description>
+               <representation-property>udn</representation-property>
+
+               <config-description-ref uri="thing-type:wemo:device"/>
        </thing-type>
 
        <thing-type id="motion">
                        <channel id="lastMotionDetected" typeId="lastMotionDetected"/>
                </channels>
 
-               <config-description>
-                       <parameter name="udn" type="text" required="true">
-                               <label>Unique Device Name</label>
-                               <description>The UDN identifies the WeMo Device</description>
-                       </parameter>
-               </config-description>
+               <representation-property>udn</representation-property>
+
+               <config-description-ref uri="thing-type:wemo:device"/>
        </thing-type>
 
        <!-- Standard WeMo Bulb with E27 socket -->
                        <channel id="sensor" typeId="sensor"/>
                </channels>
 
-               <config-description>
-                       <parameter name="udn" type="text" required="true">
-                               <label>Unique Device Name</label>
-                               <description>The UDN identifies the WeMo Device</description>
-                       </parameter>
-               </config-description>
+               <representation-property>udn</representation-property>
+
+               <config-description-ref uri="thing-type:wemo:device"/>
        </thing-type>
 
        <thing-type id="CoffeeMaker">
                        <channel id="lastCleaned" typeId="lastCleaned"/>
                </channels>
 
+               <representation-property>udn</representation-property>
+
                <config-description>
                        <parameter name="udn" type="text" required="true">
                                <label>Unique Device Name</label>
                        </parameter>
                        <parameter name="pollingInterval" type="integer" required="false" min="15" max="180">
                                <label>Polling Interval</label>
-                               <description>Interval polling the WeMo Coffee Maker.
-                               </description>
+                               <description>Interval polling the WeMo Coffee Maker.</description>
                                <default>60</default>
                        </parameter>
                </config-description>
                        <channel id="nightModeBrightness" typeId="nightModeBrightness"/>
                </channels>
 
-               <config-description>
-                       <parameter name="udn" type="text" required="true">
-                               <label>Unique Device Name</label>
-                               <description>The UDN identifies the WeMo Device</description>
-                       </parameter>
-               </config-description>
+               <representation-property>udn</representation-property>
+
+               <config-description-ref uri="thing-type:wemo:device"/>
        </thing-type>
 
        <thing-type id="Crockpot">
                        <channel id="cookedTime" typeId="cookedTime"/>
                </channels>
 
-               <config-description>
-                       <parameter name="udn" type="text">
-                               <label>Unique Device Name</label>
-                               <description>The UDN identifies the WeMo Device</description>
-                               <required>true</required>
-                       </parameter>
-               </config-description>
+               <representation-property>udn</representation-property>
+
+               <config-description-ref uri="thing-type:wemo:device"/>
        </thing-type>
 
        <thing-type id="Purifier">
                        <channel id="filterPresent" typeId="filterPresent"/>
                </channels>
 
-               <config-description>
-                       <parameter name="udn" type="text">
-                               <label>Unique Device Name</label>
-                               <description>The UDN identifies the WeMo Device</description>
-                               <required>true</required>
-                       </parameter>
-               </config-description>
+               <representation-property>udn</representation-property>
+
+               <config-description-ref uri="thing-type:wemo:device"/>
        </thing-type>
 
        <thing-type id="Humidifier">
                        <channel id="expiredFilterTime" typeId="expiredFilterTime"/>
                </channels>
 
-               <config-description>
-                       <parameter name="udn" type="text">
-                               <label>Unique Device Name</label>
-                               <description>The UDN identifies the WeMo Device</description>
-                               <required>true</required>
-                       </parameter>
-               </config-description>
+               <representation-property>udn</representation-property>
+
+               <config-description-ref uri="thing-type:wemo:device"/>
        </thing-type>
 
        <thing-type id="Heater">
                        <channel id="heatingRemaining" typeId="heatingRemaining"/>
                </channels>
 
-               <config-description>
-                       <parameter name="udn" type="text">
-                               <label>Unique Device Name</label>
-                               <description>The UDN identifies the WeMo Device</description>
-                               <required>true</required>
-                       </parameter>
-               </config-description>
+               <representation-property>udn</representation-property>
+
+               <config-description-ref uri="thing-type:wemo:device"/>
        </thing-type>
 
        <channel-type id="state">