Skip to content

Commit

Permalink
[neeo] Fixed event nullness (openhab#10651)
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
  • Loading branch information
cweitkamp authored May 6, 2021
1 parent 7c6b3e8 commit 914f7f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -236,8 +235,7 @@ public String getLabel() {
*
* @return the value
*/
@Nullable
public String getValue() {
public @Nullable String getValue() {
return value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ private void handleSetValue(HttpServletResponse resp, PathInfo pathInfo) {
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);
Expand Down

0 comments on commit 914f7f5

Please sign in to comment.