[epsonprojector] Fix keycode channel to allow non-numeric characters (#9698)
* Fix keycode channel to allow non-numeric characters Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com> * Add additional enum values Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
This commit is contained in:
parent
9368f44896
commit
8864566e18
@ -53,7 +53,7 @@ Some notes:
|
|||||||
## Channels
|
## Channels
|
||||||
|
|
||||||
| Channel | Item Type | Purpose | Values |
|
| Channel | Item Type | Purpose | Values |
|
||||||
| ------------------ | --------- | --------------------------------------------------- | --------- |
|
| ------------------ | --------- | ----------------------------------------------------------------- | --------- |
|
||||||
| power | Switch | Powers the projector on or off. | |
|
| power | Switch | Powers the projector on or off. | |
|
||||||
| powerstate | String | Retrieves the textual power state of the projector. | Read only |
|
| powerstate | String | Retrieves the textual power state of the projector. | Read only |
|
||||||
| source | String | Retrieve or set the input source. | See above |
|
| source | String | Retrieve or set the input source. | See above |
|
||||||
@ -78,7 +78,7 @@ Some notes:
|
|||||||
| verticalreverse | Switch | Turn the vertical reverse mode on or off. | |
|
| verticalreverse | Switch | Turn the vertical reverse mode on or off. | |
|
||||||
| horizontalreverse | Switch | Turn the horizontal reverse mode on or off. | |
|
| horizontalreverse | Switch | Turn the horizontal reverse mode on or off. | |
|
||||||
| background | String | Retrieve or set the background color/logo. | See above |
|
| background | String | Retrieve or set the background color/logo. | See above |
|
||||||
| keycode | Number | Send a key operation command to the projector. | Send only |
|
| keycode | String | Send a key operation command to the projector. (2 character code) | Send only |
|
||||||
| lamptime | Number | Retrieves the lamp hours. | Read only |
|
| lamptime | Number | Retrieves the lamp hours. | Read only |
|
||||||
| errcode | Number | Retrieves the last error code. | Read only |
|
| errcode | Number | Retrieves the last error code. | Read only |
|
||||||
| errmessage | String | Retrieves the description of the last error. | Read only |
|
| errmessage | String | Retrieves the description of the last error. | Read only |
|
||||||
@ -99,36 +99,37 @@ epsonprojector:projector-tcp:hometheater "Projector" [ host="192.168.0.10", por
|
|||||||
items/epson.items
|
items/epson.items
|
||||||
|
|
||||||
```
|
```
|
||||||
Switch epsonPower { channel="epsonprojector:projector:hometheater:power" }
|
Switch epsonPower { channel="epsonprojector:projector-serial:hometheater:power" }
|
||||||
String epsonSource "Source [%s]" { channel="epsonprojector:projector:hometheater:source" }
|
String epsonSource "Source [%s]" { channel="epsonprojector:projector-serial:hometheater:source" }
|
||||||
String epsonAspectRatio "Aspect Ratio [%s]" { channel="epsonprojector:projector:hometheater:aspectratio" }
|
String epsonAspectRatio "Aspect Ratio [%s]" { channel="epsonprojector:projector-serial:hometheater:aspectratio" }
|
||||||
String epsonColorMode "Color Mode [%s]" { channel="epsonprojector:projector:hometheater:colormode" }
|
String epsonColorMode "Color Mode [%s]" { channel="epsonprojector:projector-serial:hometheater:colormode" }
|
||||||
Switch epsonFreeze { channel="epsonprojector:projector:hometheater:freeze" }
|
Switch epsonFreeze { channel="epsonprojector:projector-serial:hometheater:freeze" }
|
||||||
Switch epsonMute { channel="epsonprojector:projector:hometheater:mute" }
|
Switch epsonMute { channel="epsonprojector:projector-serial:hometheater:mute" }
|
||||||
Number epsonVolume { channel="epsonprojector:projector:hometheater:volume" }
|
Number epsonVolume { channel="epsonprojector:projector-serial:hometheater:volume" }
|
||||||
String epsonLuminance "Lamp Mode [%s]" { channel="epsonprojector:projector:hometheater:luminance" }
|
String epsonLuminance "Lamp Mode [%s]" { channel="epsonprojector:projector-serial:hometheater:luminance" }
|
||||||
|
|
||||||
Number epsonBrightness { channel="epsonprojector:projector:hometheater:brightness" }
|
Number epsonBrightness { channel="epsonprojector:projector-serial:hometheater:brightness" }
|
||||||
Number epsonContrast { channel="epsonprojector:projector:hometheater:contrast" }
|
Number epsonContrast { channel="epsonprojector:projector-serial:hometheater:contrast" }
|
||||||
Number epsonDensity { channel="epsonprojector:projector:hometheater:density" }
|
Number epsonDensity { channel="epsonprojector:projector-serial:hometheater:density" }
|
||||||
Number epsonTint { channel="epsonprojector:projector:hometheater:tint" }
|
Number epsonTint { channel="epsonprojector:projector-serial:hometheater:tint" }
|
||||||
Number epsonColorTemperature { channel="epsonprojector:projector:hometheater:colortemperature" }
|
Number epsonColorTemperature { channel="epsonprojector:projector-serial:hometheater:colortemperature" }
|
||||||
Number epsonFleshTemperature { channel="epsonprojector:projector:hometheater:fleshtemperature" }
|
Number epsonFleshTemperature { channel="epsonprojector:projector-serial:hometheater:fleshtemperature" }
|
||||||
String epsonGamma "Gamma [%s]" { channel="epsonprojector:projector:hometheater:gamma" }
|
String epsonGamma "Gamma [%s]" { channel="epsonprojector:projector-serial:hometheater:gamma" }
|
||||||
|
|
||||||
Switch epsonAutokeystone { channel="epsonprojector:projector:hometheater:autokeystone" }
|
Switch epsonAutokeystone { channel="epsonprojector:projector-serial:hometheater:autokeystone" }
|
||||||
Number epsonVerticalKeystone { channel="epsonprojector:projector:hometheater:verticalkeystone" }
|
Number epsonVerticalKeystone { channel="epsonprojector:projector-serial:hometheater:verticalkeystone" }
|
||||||
Number epsonHorizontalKeystone { channel="epsonprojector:projector:hometheater:horizontalkeystone" }
|
Number epsonHorizontalKeystone { channel="epsonprojector:projector-serial:hometheater:horizontalkeystone" }
|
||||||
Number epsonVerticalPosition { channel="epsonprojector:projector:hometheater:verticalposition" }
|
Number epsonVerticalPosition { channel="epsonprojector:projector-serial:hometheater:verticalposition" }
|
||||||
Number epsonHorizontalPosition { channel="epsonprojector:projector:hometheater:horizontalposition" }
|
Number epsonHorizontalPosition { channel="epsonprojector:projector-serial:hometheater:horizontalposition" }
|
||||||
Switch epsonVerticalReverse { channel="epsonprojector:projector:hometheater:verticalreverse" }
|
Switch epsonVerticalReverse { channel="epsonprojector:projector-serial:hometheater:verticalreverse" }
|
||||||
Switch epsonHorizontalReverse { channel="epsonprojector:projector:hometheater:horizontalreverse" }
|
Switch epsonHorizontalReverse { channel="epsonprojector:projector-serial:hometheater:horizontalreverse" }
|
||||||
|
|
||||||
String epsonBackground "Background [%s]" { channel="epsonprojector:projector:hometheater:background" }
|
String epsonBackground "Background [%s]" { channel="epsonprojector:projector-serial:hometheater:background" }
|
||||||
String epsonPowerState "Power State [%s]" <switch> { channel="epsonprojector:projector:hometheater:powerstate" }
|
String epsonKeyCode "Key Code [%s]" { channel="epsonprojector:projector-serial:hometheater:keycode", autoupdate="false" }
|
||||||
Number epsonLampTime "Lamp Time [%d h]" <switch> { channel="epsonprojector:projector:hometheater:lamptime" }
|
String epsonPowerState "Power State [%s]" <switch> { channel="epsonprojector:projector-serial:hometheater:powerstate" }
|
||||||
Number epsonErrCode "Error Code [%d]" <"siren-on"> { channel="epsonprojector:projector:hometheater:errcode" }
|
Number epsonLampTime "Lamp Time [%d h]" <switch> { channel="epsonprojector:projector-serial:hometheater:lamptime" }
|
||||||
String epsonErrMessage "Error Message [%s]" <"siren-off"> { channel="epsonprojector:projector:hometheater:errmessage" }
|
Number epsonErrCode "Error Code [%d]" <"siren-on"> { channel="epsonprojector:projector-serial:hometheater:errcode" }
|
||||||
|
String epsonErrMessage "Error Message [%s]" <"siren-off"> { channel="epsonprojector:projector-serial:hometheater:errmessage" }
|
||||||
```
|
```
|
||||||
|
|
||||||
sitemaps/epson.sitemap
|
sitemaps/epson.sitemap
|
||||||
@ -142,7 +143,7 @@ sitemap epson label="Epson Projector Demo"
|
|||||||
Switch item=epsonFreeze label="Freeze"
|
Switch item=epsonFreeze label="Freeze"
|
||||||
Switch item=epsonMute label="AV Mute"
|
Switch item=epsonMute label="AV Mute"
|
||||||
Setpoint item=epsonVolume label="Volume"
|
Setpoint item=epsonVolume label="Volume"
|
||||||
|
Switch item=epsonKeyCode label="Navigation" icon="screen" mappings=["03"="Menu", "35"="˄", "36"="˅", "37"="<", "38"=">", "16"="Enter"]
|
||||||
}
|
}
|
||||||
Frame label="Adjust Image" {
|
Frame label="Adjust Image" {
|
||||||
Setpoint item=epsonBrightness label="Brightness"
|
Setpoint item=epsonBrightness label="Brightness"
|
||||||
|
|||||||
@ -31,7 +31,7 @@ public enum EpsonProjectorCommandType {
|
|||||||
POWER("Power", SwitchItem.class),
|
POWER("Power", SwitchItem.class),
|
||||||
POWER_STATE("PowerState", StringItem.class),
|
POWER_STATE("PowerState", StringItem.class),
|
||||||
LAMP_TIME("LampTime", NumberItem.class),
|
LAMP_TIME("LampTime", NumberItem.class),
|
||||||
KEY_CODE("KeyCode", NumberItem.class),
|
KEY_CODE("KeyCode", StringItem.class),
|
||||||
VKEYSTONE("VerticalKeystone", NumberItem.class),
|
VKEYSTONE("VerticalKeystone", NumberItem.class),
|
||||||
HKEYSTONE("HorizontalKeystone", NumberItem.class),
|
HKEYSTONE("HorizontalKeystone", NumberItem.class),
|
||||||
AKEYSTONE("AutoKeystone", SwitchItem.class),
|
AKEYSTONE("AutoKeystone", SwitchItem.class),
|
||||||
|
|||||||
@ -232,8 +232,8 @@ public class EpsonProjectorDevice {
|
|||||||
/*
|
/*
|
||||||
* Key code
|
* Key code
|
||||||
*/
|
*/
|
||||||
public void sendKeyCode(int value) throws EpsonProjectorCommandException, EpsonProjectorException {
|
public void sendKeyCode(String value) throws EpsonProjectorCommandException, EpsonProjectorException {
|
||||||
sendCommand(String.format("KEY %02X", value));
|
sendCommand(String.format("KEY %s", value));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -26,6 +26,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
|
|||||||
*/
|
*/
|
||||||
@NonNullByDefault
|
@NonNullByDefault
|
||||||
public enum ColorMode {
|
public enum ColorMode {
|
||||||
|
AUTO(0x00),
|
||||||
SRGB(0x01),
|
SRGB(0x01),
|
||||||
NORMAL(0x02),
|
NORMAL(0x02),
|
||||||
MEETING(0x03),
|
MEETING(0x03),
|
||||||
|
|||||||
@ -32,6 +32,7 @@ public enum PowerStatus {
|
|||||||
COOLDOWN(0x03),
|
COOLDOWN(0x03),
|
||||||
STANDBYNETWORKON(0x04),
|
STANDBYNETWORKON(0x04),
|
||||||
ABNORMALSTANDBY(0x05),
|
ABNORMALSTANDBY(0x05),
|
||||||
|
WIRELESSHDSTANDBY(0x07),
|
||||||
UNKNOWN(0xFF);
|
UNKNOWN(0xFF);
|
||||||
|
|
||||||
private final int value;
|
private final int value;
|
||||||
|
|||||||
@ -351,7 +351,7 @@ public class EpsonProjectorHandler extends BaseThingHandler {
|
|||||||
remoteController.setHorizontalReverse((command == OnOffType.ON ? Switch.ON : Switch.OFF));
|
remoteController.setHorizontalReverse((command == OnOffType.ON ? Switch.ON : Switch.OFF));
|
||||||
break;
|
break;
|
||||||
case KEY_CODE:
|
case KEY_CODE:
|
||||||
remoteController.sendKeyCode(((DecimalType) command).intValue());
|
remoteController.sendKeyCode(command.toString());
|
||||||
break;
|
break;
|
||||||
case LAMP_TIME:
|
case LAMP_TIME:
|
||||||
logger.warn("'{}' is read only parameter", commandType);
|
logger.warn("'{}' is read only parameter", commandType);
|
||||||
|
|||||||
@ -130,7 +130,7 @@
|
|||||||
<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">
|
||||||
<item-type>Number</item-type>
|
<item-type>String</item-type>
|
||||||
<label>KeyCode</label>
|
<label>KeyCode</label>
|
||||||
<description>Send a KEY Operation Command to the Projector</description>
|
<description>Send a KEY Operation Command to the Projector</description>
|
||||||
</channel-type>
|
</channel-type>
|
||||||
@ -271,6 +271,7 @@
|
|||||||
<option value="SILVER">SILVER</option>
|
<option value="SILVER">SILVER</option>
|
||||||
<option value="XVCOLOR">XVCOLOR</option>
|
<option value="XVCOLOR">XVCOLOR</option>
|
||||||
<option value="DICOMSIM">DICOMSIM</option>
|
<option value="DICOMSIM">DICOMSIM</option>
|
||||||
|
<option value="AUTO">AUTO</option>
|
||||||
</options>
|
</options>
|
||||||
</state>
|
</state>
|
||||||
</channel-type>
|
</channel-type>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user