[neeo] Fixed event nullness (#10651)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
parent
e510244cb6
commit
a1ebab11c5
|
@ -54,8 +54,7 @@ public class NeeoDeviceChannel {
|
|||
private final String label;
|
||||
|
||||
/** The action/text value */
|
||||
@Nullable
|
||||
private final String value; // could be either a format (text label) or a value to send (button)
|
||||
private final @Nullable String value; // could be either a format (text label) or a value to send (button)
|
||||
|
||||
/** The device channel range */
|
||||
private final NeeoDeviceChannelRange range;
|
||||
|
@ -236,8 +235,7 @@ public class NeeoDeviceChannel {
|
|||
*
|
||||
* @return the value
|
||||
*/
|
||||
@Nullable
|
||||
public String getValue() {
|
||||
public @Nullable String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
|
|
@ -251,7 +251,8 @@ public class NeeoBrainService extends DefaultServletService {
|
|||
final NeeoDeviceChannel channel = device.getChannel(pathInfo.getItemName(), pathInfo.getSubType(),
|
||||
pathInfo.getChannelNbr());
|
||||
if (channel != null && channel.getKind() == NeeoDeviceChannelKind.TRIGGER) {
|
||||
final ChannelTriggeredEvent event = ThingEventFactory.createTriggerEvent(channel.getValue(),
|
||||
String value = channel.getValue();
|
||||
final ChannelTriggeredEvent event = ThingEventFactory.createTriggerEvent(value == null ? "" : value,
|
||||
new ChannelUID(device.getUid(), channel.getItemName()));
|
||||
logger.debug("Posting triggered event: {}", event);
|
||||
context.getEventPublisher().post(event);
|
||||
|
|
Loading…
Reference in New Issue