]> git.basschouten.com Git - openhab-addons.git/commitdiff
[epsonprojector] Incorporate review suggestions from other PRs (#16860)
authormlobstein <michael.lobstein@gmail.com>
Sat, 8 Jun 2024 13:31:25 +0000 (08:31 -0500)
committerGitHub <noreply@github.com>
Sat, 8 Jun 2024 13:31:25 +0000 (15:31 +0200)
Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
bundles/org.openhab.binding.epsonprojector/src/main/java/org/openhab/binding/epsonprojector/internal/discovery/EpsonProjectorDiscoveryParticipant.java
bundles/org.openhab.binding.epsonprojector/src/main/java/org/openhab/binding/epsonprojector/internal/discovery/EpsonProjectorDiscoveryService.java
bundles/org.openhab.binding.epsonprojector/src/main/resources/OH-INF/addon/addon.xml
bundles/org.openhab.binding.epsonprojector/src/main/resources/OH-INF/i18n/epsonprojector.properties
bundles/org.openhab.binding.epsonprojector/src/main/resources/OH-INF/thing/thing-types.xml

index c064d8a5359acdefcb16ec7e9e1dd82db3faf572..8099364e47c488d30b5833cdf344cea7525d7f99 100644 (file)
@@ -49,7 +49,7 @@ public class EpsonProjectorDiscoveryParticipant implements SddpDiscoveryParticip
 
     @Override
     public Set<ThingTypeUID> getSupportedThingTypeUIDs() {
-        return SUPPORTED_THING_TYPES_UIDS;
+        return Set.of(THING_TYPE_PROJECTOR_TCP);
     }
 
     @Override
@@ -76,9 +76,10 @@ public class EpsonProjectorDiscoveryParticipant implements SddpDiscoveryParticip
     @Override
     public @Nullable ThingUID getThingUID(SddpDevice device) {
         if (device.manufacturer.toUpperCase(Locale.ENGLISH).contains(EPSON)
-                && device.type.toUpperCase(Locale.ENGLISH).contains(TYPE_PROJECTOR) && !device.macAddress.isBlank()) {
-
+                && device.type.toUpperCase(Locale.ENGLISH).contains(TYPE_PROJECTOR) && !device.macAddress.isBlank()
+                && !device.ipAddress.isBlank()) {
             logger.debug("Epson projector with mac {} found at {}", device.macAddress, device.ipAddress);
+
             return new ThingUID(THING_TYPE_PROJECTOR_TCP,
                     device.macAddress.replaceAll("-", "").toUpperCase(Locale.ENGLISH));
         }
index cb43300bb875126de531dcbfefc1bca3b42d22d0..8d81d9f5c3c66f42d1624f530b1f2f2a3a303dbc 100644 (file)
@@ -78,7 +78,7 @@ public class EpsonProjectorDiscoveryService extends AbstractDiscoveryService {
 
     @Override
     public Set<ThingTypeUID> getSupportedThingTypes() {
-        return SUPPORTED_THING_TYPES_UIDS;
+        return Set.of(THING_TYPE_PROJECTOR_TCP);
     }
 
     @Override
index 92184d5ceb4cebefdd5c498994657ae7fd9517ad..e60eb7cc7665a7a4697b9c7baff8cce212f22dcf 100644 (file)
                <discovery-method>
                        <service-type>sddp</service-type>
                        <match-properties>
+                               <match-property>
+                                       <name>manufacturer</name>
+                                       <regex>(?i).*epson.*</regex>
+                               </match-property>
                                <match-property>
                                        <name>type</name>
-                                       <regex>(?i)epson:projector.*</regex>
+                                       <regex>(?i).*projector.*</regex>
                                </match-property>
                        </match-properties>
                </discovery-method>
index 9a4001feb6e285189654ade310b13d0d074319b2..f427ca1349db0ef3064273b6eff45f39cd1f10f6 100644 (file)
@@ -116,7 +116,7 @@ channel-type.epsonprojector.horizontalreverse.description = Turn the Horizontal
 channel-type.epsonprojector.keycode.label = KeyCode
 channel-type.epsonprojector.keycode.description = Send a KEY Operation Command to the Projector
 channel-type.epsonprojector.lamptime.label = Lamp Time
-channel-type.epsonprojector.lamptime.description = Retrieves the Lamp Hours
+channel-type.epsonprojector.lamptime.description = Retrieves the number of hours the lamp has been used
 channel-type.epsonprojector.luminance.label = Luminance
 channel-type.epsonprojector.luminance.description = Retrieve or Set the Lamp Mode
 channel-type.epsonprojector.luminance.state.option.NORMAL = NORMAL
index 4f28d375be217ee720527c90998373683e6d5950..29745fb1b915555cb698d3805b70b415408fc13c 100644 (file)
        <channel-type id="lamptime">
                <item-type>Number</item-type>
                <label>Lamp Time</label>
-               <description>Retrieves the Lamp Hours</description>
+               <description>Retrieves the number of hours the lamp has been used</description>
                <state readOnly="true" pattern="%d h"/>
        </channel-type>
        <channel-type id="keycode" advanced="true">