mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[epsonprojector] Incorporate review suggestions from other PRs (#16860)
Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com> Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
parent
865b86769d
commit
0fbe6f7ca1
@ -49,7 +49,7 @@ public class EpsonProjectorDiscoveryParticipant implements SddpDiscoveryParticip
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<ThingTypeUID> getSupportedThingTypeUIDs() {
|
public Set<ThingTypeUID> getSupportedThingTypeUIDs() {
|
||||||
return SUPPORTED_THING_TYPES_UIDS;
|
return Set.of(THING_TYPE_PROJECTOR_TCP);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -76,9 +76,10 @@ public class EpsonProjectorDiscoveryParticipant implements SddpDiscoveryParticip
|
|||||||
@Override
|
@Override
|
||||||
public @Nullable ThingUID getThingUID(SddpDevice device) {
|
public @Nullable ThingUID getThingUID(SddpDevice device) {
|
||||||
if (device.manufacturer.toUpperCase(Locale.ENGLISH).contains(EPSON)
|
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);
|
logger.debug("Epson projector with mac {} found at {}", device.macAddress, device.ipAddress);
|
||||||
|
|
||||||
return new ThingUID(THING_TYPE_PROJECTOR_TCP,
|
return new ThingUID(THING_TYPE_PROJECTOR_TCP,
|
||||||
device.macAddress.replaceAll("-", "").toUpperCase(Locale.ENGLISH));
|
device.macAddress.replaceAll("-", "").toUpperCase(Locale.ENGLISH));
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ public class EpsonProjectorDiscoveryService extends AbstractDiscoveryService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<ThingTypeUID> getSupportedThingTypes() {
|
public Set<ThingTypeUID> getSupportedThingTypes() {
|
||||||
return SUPPORTED_THING_TYPES_UIDS;
|
return Set.of(THING_TYPE_PROJECTOR_TCP);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -12,9 +12,13 @@
|
|||||||
<discovery-method>
|
<discovery-method>
|
||||||
<service-type>sddp</service-type>
|
<service-type>sddp</service-type>
|
||||||
<match-properties>
|
<match-properties>
|
||||||
|
<match-property>
|
||||||
|
<name>manufacturer</name>
|
||||||
|
<regex>(?i).*epson.*</regex>
|
||||||
|
</match-property>
|
||||||
<match-property>
|
<match-property>
|
||||||
<name>type</name>
|
<name>type</name>
|
||||||
<regex>(?i)epson:projector.*</regex>
|
<regex>(?i).*projector.*</regex>
|
||||||
</match-property>
|
</match-property>
|
||||||
</match-properties>
|
</match-properties>
|
||||||
</discovery-method>
|
</discovery-method>
|
||||||
|
@ -116,7 +116,7 @@ channel-type.epsonprojector.horizontalreverse.description = Turn the Horizontal
|
|||||||
channel-type.epsonprojector.keycode.label = KeyCode
|
channel-type.epsonprojector.keycode.label = KeyCode
|
||||||
channel-type.epsonprojector.keycode.description = Send a KEY Operation Command to the Projector
|
channel-type.epsonprojector.keycode.description = Send a KEY Operation Command to the Projector
|
||||||
channel-type.epsonprojector.lamptime.label = Lamp Time
|
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.label = Luminance
|
||||||
channel-type.epsonprojector.luminance.description = Retrieve or Set the Lamp Mode
|
channel-type.epsonprojector.luminance.description = Retrieve or Set the Lamp Mode
|
||||||
channel-type.epsonprojector.luminance.state.option.NORMAL = NORMAL
|
channel-type.epsonprojector.luminance.state.option.NORMAL = NORMAL
|
||||||
|
@ -142,7 +142,7 @@
|
|||||||
<channel-type id="lamptime">
|
<channel-type id="lamptime">
|
||||||
<item-type>Number</item-type>
|
<item-type>Number</item-type>
|
||||||
<label>Lamp Time</label>
|
<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"/>
|
<state readOnly="true" pattern="%d h"/>
|
||||||
</channel-type>
|
</channel-type>
|
||||||
<channel-type id="keycode" advanced="true">
|
<channel-type id="keycode" advanced="true">
|
||||||
|
Loading…
Reference in New Issue
Block a user