[omnilink] Improve code quality (#18017)

* Fix minor spelling errors
* Reduce code complexity

Signed-off-by: Ethan Dye <mrtops03@gmail.com>
This commit is contained in:
Ethan Dye 2025-01-03 00:46:47 -07:00 committed by GitHub
parent 6af04fc31f
commit 705feffd54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
23 changed files with 195 additions and 244 deletions

View File

@ -47,10 +47,6 @@ public enum AreaAlarm {
return alarmBits.testBit(bit); return alarmBits.testBit(bit);
} }
public boolean isSet(int alarmBits) {
return isSet(BigInteger.valueOf(alarmBits));
}
public String getChannelUID() { public String getChannelUID() {
return channelUID; return channelUID;
} }

View File

@ -162,7 +162,6 @@ public class OmnilinkBindingConstants {
public static final String TRIGGER_CHANNEL_DCM_EVENT = "dcm_event"; public static final String TRIGGER_CHANNEL_DCM_EVENT = "dcm_event";
public static final String TRIGGER_CHANNEL_ENERGY_COST_EVENT = "energy_cost_event"; public static final String TRIGGER_CHANNEL_ENERGY_COST_EVENT = "energy_cost_event";
public static final String TRIGGER_CHANNEL_CAMERA_TRIGGER_EVENT = "camera_trigger_event"; public static final String TRIGGER_CHANNEL_CAMERA_TRIGGER_EVENT = "camera_trigger_event";
public static final String TRIGGER_CHANNEL_ACCESS_CONTROL_READER_EVENT = "access_control_reader_event";
public static final String TRIGGER_CHANNEL_AREA_ALL_ON_OFF_EVENT = "all_on_off_event"; public static final String TRIGGER_CHANNEL_AREA_ALL_ON_OFF_EVENT = "all_on_off_event";
public static final String TRIGGER_CHANNEL_SWITCH_PRESS_EVENT = "switch_press_event"; public static final String TRIGGER_CHANNEL_SWITCH_PRESS_EVENT = "switch_press_event";
public static final String TRIGGER_CHANNEL_UPB_LINK_ACTIVATED_EVENT = "upb_link_activated_event"; public static final String TRIGGER_CHANNEL_UPB_LINK_ACTIVATED_EVENT = "upb_link_activated_event";

View File

@ -51,7 +51,7 @@ public enum TemperatureFormat {
private final int formatNumber; private final int formatNumber;
private TemperatureFormat(int formatNumber) { TemperatureFormat(int formatNumber) {
this.formatNumber = formatNumber; this.formatNumber = formatNumber;
} }

View File

@ -67,11 +67,8 @@ public class OmnilinkActions implements ThingActions {
zdt = ZonedDateTime.now(ZoneId.of(zone)); zdt = ZonedDateTime.now(ZoneId.of(zone));
} else { } else {
logger.debug("Time zone provided invalid, using system default!"); logger.debug("Time zone provided invalid, using system default!");
if (timeZoneProvider.isPresent()) { zdt = timeZoneProvider.map(zoneProvider -> ZonedDateTime.now(zoneProvider.getTimeZone()))
zdt = ZonedDateTime.now(timeZoneProvider.get().getTimeZone()); .orElseGet(() -> ZonedDateTime.now(ZoneId.systemDefault()));
} else {
zdt = ZonedDateTime.now(ZoneId.systemDefault());
}
} }
actionsHandler.synchronizeControllerTime(zdt); actionsHandler.synchronizeControllerTime(zdt);
} }

View File

@ -99,9 +99,9 @@ public class OmnilinkDiscoveryService extends AbstractThingHandlerDiscoveryServi
} }
/** /**
* Calculate the area filter the a supplied area * Calculate the area filter of a supplied area
* *
* @param area Area to calculate filter for. * @param areaProperties Area to calculate filter for.
* @return Calculated Bit Filter for the supplied area. Bit 0 is area 1, bit 2 is area 2 and so on. * @return Calculated Bit Filter for the supplied area. Bit 0 is area 1, bit 2 is area 2 and so on.
*/ */
private static int bitFilterForArea(AreaProperties areaProperties) { private static int bitFilterForArea(AreaProperties areaProperties) {
@ -328,7 +328,7 @@ public class OmnilinkDiscoveryService extends AbstractThingHandlerDiscoveryServi
/** /**
* Discovers OmniLink areas * Discovers OmniLink areas
*/ */
private @Nullable List<AreaProperties> discoverAreas() { private List<AreaProperties> discoverAreas() {
final ThingUID bridgeUID = thingHandler.getThing().getUID(); final ThingUID bridgeUID = thingHandler.getThing().getUID();
List<AreaProperties> areas = new LinkedList<>(); List<AreaProperties> areas = new LinkedList<>();
@ -356,12 +356,10 @@ public class OmnilinkDiscoveryService extends AbstractThingHandlerDiscoveryServi
final String name = thingName; final String name = thingName;
systemType.ifPresentOrElse(t -> { systemType.ifPresentOrElse(t -> {
ThingUID thingUID = null; ThingUID thingUID;
switch (t) { if (t == SystemType.LUMINA) {
case LUMINA:
thingUID = new ThingUID(THING_TYPE_LUMINA_AREA, bridgeUID, thingID); thingUID = new ThingUID(THING_TYPE_LUMINA_AREA, bridgeUID, thingID);
break; } else {
default:
thingUID = new ThingUID(THING_TYPE_OMNI_AREA, bridgeUID, thingID); thingUID = new ThingUID(THING_TYPE_OMNI_AREA, bridgeUID, thingID);
} }
DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withProperties(properties) DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withProperties(properties)
@ -369,9 +367,7 @@ public class OmnilinkDiscoveryService extends AbstractThingHandlerDiscoveryServi
.withRepresentationProperty(THING_PROPERTIES_NUMBER).withBridge(bridgeUID).withLabel(name) .withRepresentationProperty(THING_PROPERTIES_NUMBER).withBridge(bridgeUID).withLabel(name)
.build(); .build();
thingDiscovered(discoveryResult); thingDiscovered(discoveryResult);
}, () -> { }, () -> logger.warn("Unknown System Type"));
logger.warn("Unknown System Type");
});
areas.add(areaProperties); areas.add(areaProperties);
} }
@ -397,7 +393,7 @@ public class OmnilinkDiscoveryService extends AbstractThingHandlerDiscoveryServi
int thingType = unitProperties.getUnitType(); int thingType = unitProperties.getUnitType();
String thingName = unitProperties.getName(); String thingName = unitProperties.getName();
String thingID = Integer.toString(unitProperties.getNumber()); String thingID = Integer.toString(unitProperties.getNumber());
ThingUID thingUID = null; ThingUID thingUID;
Map<String, Object> properties = new HashMap<>(); Map<String, Object> properties = new HashMap<>();
properties.put(THING_PROPERTIES_NAME, thingName); properties.put(THING_PROPERTIES_NAME, thingName);

View File

@ -21,8 +21,9 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
* @author Craig Hamilton - Initial contribution * @author Craig Hamilton - Initial contribution
*/ */
@NonNullByDefault @NonNullByDefault
@SuppressWarnings("serial")
public class BridgeOfflineException extends Exception { public class BridgeOfflineException extends Exception {
private static final long serialVersionUID = 1L;
public BridgeOfflineException(Exception e) { public BridgeOfflineException(Exception e) {
super(e); super(e);
} }

View File

@ -67,14 +67,14 @@ public abstract class AbstractAreaHandler extends AbstractOmnilinkStatusHandler<
super.initialize(); super.initialize();
if (bridgeHandler != null) { if (bridgeHandler != null) {
updateAreaProperties(bridgeHandler); updateAreaProperties();
} else { } else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR, updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR,
"Received null bridge while initializing Area!"); "Received null bridge while initializing Area!");
} }
} }
private void updateAreaProperties(OmnilinkBridgeHandler bridgeHandler) { private void updateAreaProperties() {
final List<AreaProperties> areas = getAreaProperties(); final List<AreaProperties> areas = getAreaProperties();
if (areas != null) { if (areas != null) {
for (AreaProperties areaProperties : areas) { for (AreaProperties areaProperties : areas) {
@ -99,13 +99,10 @@ public abstract class AbstractAreaHandler extends AbstractOmnilinkStatusHandler<
return; return;
} }
switch (channelUID.getId()) { if (channelUID.getId().equals(CHANNEL_AREA_ACTIVATE_KEYPAD_EMERGENCY)) {
case CHANNEL_AREA_ACTIVATE_KEYPAD_EMERGENCY: handleKeypadEmergency(command);
handleKeypadEmergency(channelUID, command); } else {
break;
default:
handleSecurityMode(channelUID, command); handleSecurityMode(channelUID, command);
break;
} }
} }
@ -176,7 +173,7 @@ public abstract class AbstractAreaHandler extends AbstractOmnilinkStatusHandler<
*/ */
protected abstract EnumSet<AreaAlarm> getAlarms(); protected abstract EnumSet<AreaAlarm> getAlarms();
private void handleKeypadEmergency(ChannelUID channelUID, Command command) { private void handleKeypadEmergency(Command command) {
if (command instanceof DecimalType decimalCommand) { if (command instanceof DecimalType decimalCommand) {
try { try {
final OmnilinkBridgeHandler bridge = getOmnilinkBridgeHandler(); final OmnilinkBridgeHandler bridge = getOmnilinkBridgeHandler();

View File

@ -71,7 +71,7 @@ public abstract class AbstractOmnilinkHandler extends BaseThingHandler {
} }
/** /**
* Calculate the area filter the a supplied area * Calculate the area filter of a supplied area
* *
* @param areaProperties Area to calculate filter for. * @param areaProperties Area to calculate filter for.
* @return Calculated Bit Filter for the supplied area. Bit 0 is area 1, bit 2 is area 2 and so on. * @return Calculated Bit Filter for the supplied area. Bit 0 is area 1, bit 2 is area 2 and so on.
@ -120,7 +120,7 @@ public abstract class AbstractOmnilinkHandler extends BaseThingHandler {
protected int getAreaNumber() { protected int getAreaNumber() {
String areaNumber = getThing().getProperties().get(THING_PROPERTIES_AREA); String areaNumber = getThing().getProperties().get(THING_PROPERTIES_AREA);
if (areaNumber != null) { if (areaNumber != null) {
return Integer.valueOf(areaNumber); return Integer.parseInt(areaNumber);
} else { } else {
return -1; return -1;
} }

View File

@ -25,7 +25,7 @@ import com.digitaldan.jomnilinkII.MessageTypes.statuses.Status;
/** /**
* The {@link AbstractOmnilinkStatusHandler} defines some methods that can be used across * The {@link AbstractOmnilinkStatusHandler} defines some methods that can be used across
* the many different units exposed by the OmniLink protocol to retrive updated status information. * the many different units exposed by the OmniLink protocol to retrieve updated status information.
* *
* @author Craig Hamilton - Initial contribution * @author Craig Hamilton - Initial contribution
* @author Ethan Dye - openHAB3 rewrite * @author Ethan Dye - openHAB3 rewrite

View File

@ -50,7 +50,6 @@ import com.digitaldan.jomnilinkII.OmniUnknownMessageTypeException;
@NonNullByDefault @NonNullByDefault
public class AudioSourceHandler extends AbstractOmnilinkHandler { public class AudioSourceHandler extends AbstractOmnilinkHandler {
private final Logger logger = LoggerFactory.getLogger(AudioSourceHandler.class); private final Logger logger = LoggerFactory.getLogger(AudioSourceHandler.class);
private final int pollDelaySeconds = 5;
private final int thingID = getThingNumber(); private final int thingID = getThingNumber();
private @Nullable ScheduledFuture<?> scheduledPolling = null; private @Nullable ScheduledFuture<?> scheduledPolling = null;
public @Nullable String number; public @Nullable String number;
@ -64,7 +63,7 @@ public class AudioSourceHandler extends AbstractOmnilinkHandler {
final OmnilinkBridgeHandler bridgeHandler = getOmnilinkBridgeHandler(); final OmnilinkBridgeHandler bridgeHandler = getOmnilinkBridgeHandler();
if (bridgeHandler != null) { if (bridgeHandler != null) {
updateStatus(ThingStatus.ONLINE); updateStatus(ThingStatus.ONLINE);
if (((Boolean) getThing().getConfiguration().get(THING_PROPERTIES_AUTOSTART)).booleanValue()) { if ((Boolean) getThing().getConfiguration().get(THING_PROPERTIES_AUTOSTART)) {
logger.debug("Autostart enabled, scheduling polling for Audio Source: {}", thingID); logger.debug("Autostart enabled, scheduling polling for Audio Source: {}", thingID);
schedulePolling(); schedulePolling();
} else { } else {
@ -104,6 +103,7 @@ public class AudioSourceHandler extends AbstractOmnilinkHandler {
private synchronized void schedulePolling() { private synchronized void schedulePolling() {
cancelPolling(); cancelPolling();
logger.debug("Scheduling polling for Audio Source: {}", thingID); logger.debug("Scheduling polling for Audio Source: {}", thingID);
int pollDelaySeconds = 5;
scheduledPolling = super.scheduler.scheduleWithFixedDelay(this::pollAudioSource, 0, pollDelaySeconds, scheduledPolling = super.scheduler.scheduleWithFixedDelay(this::pollAudioSource, 0, pollDelaySeconds,
TimeUnit.SECONDS); TimeUnit.SECONDS);
} }
@ -113,8 +113,7 @@ public class AudioSourceHandler extends AbstractOmnilinkHandler {
logger.debug("handleCommand called for channel: {}, command: {}", channelUID, command); logger.debug("handleCommand called for channel: {}, command: {}", channelUID, command);
final ScheduledFuture<?> scheduledPolling = this.scheduledPolling; final ScheduledFuture<?> scheduledPolling = this.scheduledPolling;
switch (channelUID.getId()) { if (CHANNEL_AUDIO_SOURCE_POLLING.equals(channelUID.getId())) {
case CHANNEL_AUDIO_SOURCE_POLLING:
if (command instanceof RefreshType) { if (command instanceof RefreshType) {
updateState(CHANNEL_AUDIO_SOURCE_POLLING, updateState(CHANNEL_AUDIO_SOURCE_POLLING,
OnOffType.from((scheduledPolling != null && !scheduledPolling.isDone()))); OnOffType.from((scheduledPolling != null && !scheduledPolling.isDone())));
@ -123,8 +122,7 @@ public class AudioSourceHandler extends AbstractOmnilinkHandler {
} else { } else {
logger.debug("Invalid command: {}, must be RefreshType or OnOffType", command); logger.debug("Invalid command: {}, must be RefreshType or OnOffType", command);
} }
break; } else {
default:
logger.warn("Unknown channel for Audio Source thing: {}", channelUID); logger.warn("Unknown channel for Audio Source thing: {}", channelUID);
} }
} }
@ -174,7 +172,7 @@ public class AudioSourceHandler extends AbstractOmnilinkHandler {
logger.debug("Received null bridge while polling Audio Source statuses!"); logger.debug("Received null bridge while polling Audio Source statuses!");
} }
} catch (OmniInvalidResponseException | OmniUnknownMessageTypeException | BridgeOfflineException e) { } catch (OmniInvalidResponseException | OmniUnknownMessageTypeException | BridgeOfflineException e) {
logger.debug("Exception recieved while polling for Audio Source statuses: {}", e.getMessage()); logger.debug("Exception received while polling for Audio Source statuses: {}", e.getMessage());
} }
} }
} }

View File

@ -95,16 +95,14 @@ public class ButtonHandler extends AbstractOmnilinkHandler {
return; return;
} }
switch (channelUID.getId()) { if (CHANNEL_BUTTON_PRESS.equals(channelUID.getId())) {
case CHANNEL_BUTTON_PRESS:
if (command instanceof OnOffType) { if (command instanceof OnOffType) {
sendOmnilinkCommand(CommandMessage.CMD_BUTTON, 0, thingID); sendOmnilinkCommand(CommandMessage.CMD_BUTTON, 0, thingID);
updateChannels(); updateChannels();
} else { } else {
logger.debug("Invalid command: {}, must be OnOffType", command); logger.debug("Invalid command: {}, must be OnOffType", command);
} }
break; } else {
default:
logger.warn("Unknown channel for Button thing: {}", channelUID); logger.warn("Unknown channel for Button thing: {}", channelUID);
} }
} }

View File

@ -125,7 +125,7 @@ public class HumiditySensorHandler extends AbstractOmnilinkStatusHandler<Extende
thingID); thingID);
break; break;
default: default:
logger.warn("Unknown channel for Humdity Sensor thing: {}", channelUID); logger.warn("Unknown channel for Humidity Sensor thing: {}", channelUID);
} }
} }

View File

@ -88,16 +88,15 @@ public class LockHandler extends AbstractOmnilinkStatusHandler<ExtendedAccessCon
return; return;
} }
switch (channelUID.getId()) { if (CHANNEL_LOCK_SWITCH.equals(channelUID.getId())) {
case CHANNEL_LOCK_SWITCH:
if (command instanceof OnOffType) { if (command instanceof OnOffType) {
sendOmnilinkCommand(OnOffType.OFF.equals(command) ? CommandMessage.CMD_UNLOCK_DOOR sendOmnilinkCommand(
: CommandMessage.CMD_LOCK_DOOR, 0, thingID); OnOffType.OFF.equals(command) ? CommandMessage.CMD_UNLOCK_DOOR : CommandMessage.CMD_LOCK_DOOR,
0, thingID);
} else { } else {
logger.debug("Invalid command {}, must be OnOffType", command); logger.debug("Invalid command {}, must be OnOffType", command);
} }
break; } else {
default:
logger.warn("Unknown channel for Lock thing: {}", channelUID); logger.warn("Unknown channel for Lock thing: {}", channelUID);
} }
} }

View File

@ -44,22 +44,15 @@ public class LuminaAreaHandler extends AbstractAreaHandler {
@Override @Override
protected int getMode(ChannelUID channelUID) { protected int getMode(ChannelUID channelUID) {
switch (channelUID.getId()) { return switch (channelUID.getId()) {
case CHANNEL_AREA_SECURITY_MODE_HOME: case CHANNEL_AREA_SECURITY_MODE_HOME -> CommandMessage.CMD_SECURITY_LUMINA_HOME_MODE;
return CommandMessage.CMD_SECURITY_LUMINA_HOME_MODE; case CHANNEL_AREA_SECURITY_MODE_SLEEP -> CommandMessage.CMD_SECURITY_LUMINA_SLEEP_MODE;
case CHANNEL_AREA_SECURITY_MODE_SLEEP: case CHANNEL_AREA_SECURITY_MODE_AWAY -> CommandMessage.CMD_SECURITY_LUMINA_AWAY_MODE;
return CommandMessage.CMD_SECURITY_LUMINA_SLEEP_MODE; case CHANNEL_AREA_SECURITY_MODE_VACATION -> CommandMessage.CMD_SECURITY_LUMINA_VACATION_MODE;
case CHANNEL_AREA_SECURITY_MODE_AWAY: case CHANNEL_AREA_SECURITY_MODE_PARTY -> CommandMessage.CMD_SECURITY_LUMINA_PARTY_MODE;
return CommandMessage.CMD_SECURITY_LUMINA_AWAY_MODE; case CHANNEL_AREA_SECURITY_MODE_SPECIAL -> CommandMessage.CMD_SECURITY_LUMINA_SPECIAL_MODE;
case CHANNEL_AREA_SECURITY_MODE_VACATION: default -> throw new IllegalStateException("Unknown channel for area thing " + channelUID);
return CommandMessage.CMD_SECURITY_LUMINA_VACATION_MODE; };
case CHANNEL_AREA_SECURITY_MODE_PARTY:
return CommandMessage.CMD_SECURITY_LUMINA_PARTY_MODE;
case CHANNEL_AREA_SECURITY_MODE_SPECIAL:
return CommandMessage.CMD_SECURITY_LUMINA_SPECIAL_MODE;
default:
throw new IllegalStateException("Unknown channel for area thing " + channelUID);
}
} }
@Override @Override

View File

@ -45,24 +45,16 @@ public class OmniAreaHandler extends AbstractAreaHandler {
@Override @Override
protected int getMode(ChannelUID channelUID) { protected int getMode(ChannelUID channelUID) {
switch (channelUID.getId()) { return switch (channelUID.getId()) {
case CHANNEL_AREA_SECURITY_MODE_DISARM: case CHANNEL_AREA_SECURITY_MODE_DISARM -> CommandMessage.CMD_SECURITY_OMNI_DISARM;
return CommandMessage.CMD_SECURITY_OMNI_DISARM; case CHANNEL_AREA_SECURITY_MODE_DAY -> CommandMessage.CMD_SECURITY_OMNI_DAY_MODE;
case CHANNEL_AREA_SECURITY_MODE_DAY: case CHANNEL_AREA_SECURITY_MODE_NIGHT -> CommandMessage.CMD_SECURITY_OMNI_NIGHT_MODE;
return CommandMessage.CMD_SECURITY_OMNI_DAY_MODE; case CHANNEL_AREA_SECURITY_MODE_AWAY -> CommandMessage.CMD_SECURITY_OMNI_AWAY_MODE;
case CHANNEL_AREA_SECURITY_MODE_NIGHT: case CHANNEL_AREA_SECURITY_MODE_VACATION -> CommandMessage.CMD_SECURITY_OMNI_VACATION_MODE;
return CommandMessage.CMD_SECURITY_OMNI_NIGHT_MODE; case CHANNEL_AREA_SECURITY_MODE_DAY_INSTANT -> CommandMessage.CMD_SECURITY_OMNI_DAY_INSTANT_MODE;
case CHANNEL_AREA_SECURITY_MODE_AWAY: case CHANNEL_AREA_SECURITY_MODE_NIGHT_DELAYED -> CommandMessage.CMD_SECURITY_OMNI_NIGHT_DELAYED_MODE;
return CommandMessage.CMD_SECURITY_OMNI_AWAY_MODE; default -> throw new IllegalStateException("Unknown channel for area thing " + channelUID);
case CHANNEL_AREA_SECURITY_MODE_VACATION: };
return CommandMessage.CMD_SECURITY_OMNI_VACATION_MODE;
case CHANNEL_AREA_SECURITY_MODE_DAY_INSTANT:
return CommandMessage.CMD_SECURITY_OMNI_DAY_INSTANT_MODE;
case CHANNEL_AREA_SECURITY_MODE_NIGHT_DELAYED:
return CommandMessage.CMD_SECURITY_OMNI_NIGHT_DELAYED_MODE;
default:
throw new IllegalStateException("Unknown channel for area thing " + channelUID);
}
} }
@Override @Override

View File

@ -95,7 +95,6 @@ public class OmnilinkBridgeHandler extends BaseBridgeHandler implements Notifica
private @Nullable Connection omniConnection = null; private @Nullable Connection omniConnection = null;
private @Nullable ScheduledFuture<?> connectJob; private @Nullable ScheduledFuture<?> connectJob;
private @Nullable ScheduledFuture<?> eventPollingJob; private @Nullable ScheduledFuture<?> eventPollingJob;
private final int autoReconnectPeriod = 60;
private Optional<AudioPlayer> audioPlayer = Optional.empty(); private Optional<AudioPlayer> audioPlayer = Optional.empty();
private Optional<SystemType> systemType = Optional.empty(); private Optional<SystemType> systemType = Optional.empty();
private final Gson gson = new Gson(); private final Gson gson = new Gson();
@ -240,8 +239,8 @@ public class OmnilinkBridgeHandler extends BaseBridgeHandler implements Notifica
* HAI only supports one audio player - cycle through features until we find a feature that is an audio * HAI only supports one audio player - cycle through features until we find a feature that is an audio
* player. * player.
*/ */
audioPlayer = Objects.requireNonNull(reqSystemFeatures().getFeatures().stream() audioPlayer = Objects.requireNonNull(
.map(featureCode -> AudioPlayer.getAudioPlayerForFeatureCode(featureCode)) reqSystemFeatures().getFeatures().stream().map(AudioPlayer::getAudioPlayerForFeatureCode)
.filter(Optional::isPresent).findFirst().orElse(Optional.empty())); .filter(Optional::isPresent).findFirst().orElse(Optional.empty()));
systemType = SystemType.getType(reqSystemInformation().getModel()); systemType = SystemType.getType(reqSystemInformation().getModel());
@ -288,53 +287,54 @@ public class OmnilinkBridgeHandler extends BaseBridgeHandler implements Notifica
if (objectStatus != null) { if (objectStatus != null) {
Status[] statuses = objectStatus.getStatuses(); Status[] statuses = objectStatus.getStatuses();
for (Status status : statuses) { for (Status status : statuses) {
if (status instanceof ExtendedUnitStatus unitStatus) { switch (status) {
case ExtendedUnitStatus unitStatus -> {
int unitNumber = unitStatus.getNumber(); int unitNumber = unitStatus.getNumber();
logger.debug("Received status update for Unit: {}, status: {}", unitNumber, unitStatus); logger.debug("Received status update for Unit: {}, status: {}", unitNumber, unitStatus);
Optional<Thing> theThing = getUnitThing(unitNumber); Optional<Thing> theThing = getUnitThing(unitNumber);
theThing.map(Thing::getHandler) theThing.map(Thing::getHandler)
.ifPresent(theHandler -> ((UnitHandler) theHandler).handleStatus(unitStatus)); .ifPresent(theHandler -> ((UnitHandler) theHandler).handleStatus(unitStatus));
} else if (status instanceof ExtendedZoneStatus zoneStatus) { }
case ExtendedZoneStatus zoneStatus -> {
int zoneNumber = zoneStatus.getNumber(); int zoneNumber = zoneStatus.getNumber();
logger.debug("Received status update for Zone: {}, status: {}", zoneNumber, zoneStatus); logger.debug("Received status update for Zone: {}, status: {}", zoneNumber, zoneStatus);
Optional<Thing> theThing = getChildThing(THING_TYPE_ZONE, zoneNumber); Optional<Thing> theThing = getChildThing(THING_TYPE_ZONE, zoneNumber);
theThing.map(Thing::getHandler) theThing.map(Thing::getHandler)
.ifPresent(theHandler -> ((ZoneHandler) theHandler).handleStatus(zoneStatus)); .ifPresent(theHandler -> ((ZoneHandler) theHandler).handleStatus(zoneStatus));
} else if (status instanceof ExtendedAreaStatus areaStatus) { }
case ExtendedAreaStatus areaStatus -> {
int areaNumber = areaStatus.getNumber(); int areaNumber = areaStatus.getNumber();
logger.debug("Received status update for Area: {}, status: {}", areaNumber, areaStatus); logger.debug("Received status update for Area: {}, status: {}", areaNumber, areaStatus);
systemType.ifPresent(t -> { systemType.ifPresent(t -> {
Optional<Thing> theThing = Optional.empty(); Optional<Thing> theThing = switch (t) {
switch (t) { case LUMINA -> getChildThing(THING_TYPE_LUMINA_AREA, areaNumber);
case LUMINA: case OMNI -> getChildThing(THING_TYPE_OMNI_AREA, areaNumber);
theThing = getChildThing(THING_TYPE_LUMINA_AREA, areaNumber); };
break; theThing.map(Thing::getHandler).ifPresent(
case OMNI: theHandler -> ((AbstractAreaHandler) theHandler).handleStatus(areaStatus));
theThing = getChildThing(THING_TYPE_OMNI_AREA, areaNumber);
break;
}
theThing.map(Thing::getHandler)
.ifPresent(theHandler -> ((AbstractAreaHandler) theHandler).handleStatus(areaStatus));
}); });
} else if (status instanceof ExtendedAccessControlReaderLockStatus lockStatus) { }
case ExtendedAccessControlReaderLockStatus lockStatus -> {
int lockNumber = lockStatus.getNumber(); int lockNumber = lockStatus.getNumber();
logger.debug("Received status update for Lock: {}, status: {}", lockNumber, lockStatus); logger.debug("Received status update for Lock: {}, status: {}", lockNumber, lockStatus);
Optional<Thing> theThing = getChildThing(THING_TYPE_LOCK, lockNumber); Optional<Thing> theThing = getChildThing(THING_TYPE_LOCK, lockNumber);
theThing.map(Thing::getHandler) theThing.map(Thing::getHandler)
.ifPresent(theHandler -> ((LockHandler) theHandler).handleStatus(lockStatus)); .ifPresent(theHandler -> ((LockHandler) theHandler).handleStatus(lockStatus));
} else if (status instanceof ExtendedThermostatStatus thermostatStatus) { }
case ExtendedThermostatStatus thermostatStatus -> {
int thermostatNumber = thermostatStatus.getNumber(); int thermostatNumber = thermostatStatus.getNumber();
logger.debug("Received status update for Thermostat: {}, status: {}", thermostatNumber, logger.debug("Received status update for Thermostat: {}, status: {}", thermostatNumber,
thermostatStatus); thermostatStatus);
Optional<Thing> theThing = getChildThing(THING_TYPE_THERMOSTAT, thermostatNumber); Optional<Thing> theThing = getChildThing(THING_TYPE_THERMOSTAT, thermostatNumber);
theThing.map(Thing::getHandler) theThing.map(Thing::getHandler).ifPresent(
.ifPresent(theHandler -> ((ThermostatHandler) theHandler).handleStatus(thermostatStatus)); theHandler -> ((ThermostatHandler) theHandler).handleStatus(thermostatStatus));
} else if (status instanceof ExtendedAudioZoneStatus audioZoneStatus) { }
case ExtendedAudioZoneStatus audioZoneStatus -> {
int audioZoneNumber = audioZoneStatus.getNumber(); int audioZoneNumber = audioZoneStatus.getNumber();
logger.debug("Received status update for Audio Zone: {}, status: {}", audioZoneNumber, logger.debug("Received status update for Audio Zone: {}, status: {}", audioZoneNumber,
@ -342,15 +342,16 @@ public class OmnilinkBridgeHandler extends BaseBridgeHandler implements Notifica
Optional<Thing> theThing = getChildThing(THING_TYPE_AUDIO_ZONE, audioZoneNumber); Optional<Thing> theThing = getChildThing(THING_TYPE_AUDIO_ZONE, audioZoneNumber);
theThing.map(Thing::getHandler) theThing.map(Thing::getHandler)
.ifPresent(theHandler -> ((AudioZoneHandler) theHandler).handleStatus(audioZoneStatus)); .ifPresent(theHandler -> ((AudioZoneHandler) theHandler).handleStatus(audioZoneStatus));
} else if (status instanceof ExtendedAuxSensorStatus auxSensorStatus) { }
case ExtendedAuxSensorStatus auxSensorStatus -> {
int auxSensorNumber = auxSensorStatus.getNumber(); int auxSensorNumber = auxSensorStatus.getNumber();
// Aux Sensors can be either temperature or humidity, need to check both. // Aux Sensors can be either temperature or humidity, need to check both.
Optional<Thing> tempThing = getChildThing(THING_TYPE_TEMP_SENSOR, auxSensorNumber); Optional<Thing> tempThing = getChildThing(THING_TYPE_TEMP_SENSOR, auxSensorNumber);
Optional<Thing> humidityThing = getChildThing(THING_TYPE_HUMIDITY_SENSOR, auxSensorNumber); Optional<Thing> humidityThing = getChildThing(THING_TYPE_HUMIDITY_SENSOR, auxSensorNumber);
if (tempThing.isPresent()) { if (tempThing.isPresent()) {
logger.debug("Received status update for Temperature Sensor: {}, status: {}", auxSensorNumber, logger.debug("Received status update for Temperature Sensor: {}, status: {}",
auxSensorStatus); auxSensorNumber, auxSensorStatus);
tempThing.map(Thing::getHandler).ifPresent( tempThing.map(Thing::getHandler).ifPresent(
theHandler -> ((TempSensorHandler) theHandler).handleStatus(auxSensorStatus)); theHandler -> ((TempSensorHandler) theHandler).handleStatus(auxSensorStatus));
} }
@ -360,7 +361,8 @@ public class OmnilinkBridgeHandler extends BaseBridgeHandler implements Notifica
humidityThing.map(Thing::getHandler).ifPresent( humidityThing.map(Thing::getHandler).ifPresent(
theHandler -> ((HumiditySensorHandler) theHandler).handleStatus(auxSensorStatus)); theHandler -> ((HumiditySensorHandler) theHandler).handleStatus(auxSensorStatus));
} }
} else { }
case null, default ->
logger.debug("Received Object Status Notification that was not processed: {}", objectStatus); logger.debug("Received Object Status Notification that was not processed: {}", objectStatus);
} }
} }
@ -476,12 +478,9 @@ public class OmnilinkBridgeHandler extends BaseBridgeHandler implements Notifica
SystemStatus status = getOmniConnection().reqSystemStatus(); SystemStatus status = getOmniConnection().reqSystemStatus();
logger.debug("Received system status: {}", status); logger.debug("Received system status: {}", status);
// Update controller's reported time // Update controller's reported time
String dateString = new StringBuilder().append(2000 + status.getYear()).append("-") String dateString = (2000 + status.getYear()) + "-" + String.format("%02d", status.getMonth()) + "-"
.append(String.format("%02d", status.getMonth())).append("-") + String.format("%02d", status.getDay()) + "T" + String.format("%02d", status.getHour()) + ":"
.append(String.format("%02d", status.getDay())).append("T") + String.format("%02d", status.getMinute()) + ":" + String.format("%02d", status.getSecond());
.append(String.format("%02d", status.getHour())).append(":")
.append(String.format("%02d", status.getMinute())).append(":")
.append(String.format("%02d", status.getSecond())).toString();
updateState(CHANNEL_SYSTEM_DATE, new DateTimeType(dateString)); updateState(CHANNEL_SYSTEM_DATE, new DateTimeType(dateString));
} }
@ -578,10 +577,8 @@ public class OmnilinkBridgeHandler extends BaseBridgeHandler implements Notifica
SystemInformation systemInformation = reqSystemInformation(); SystemInformation systemInformation = reqSystemInformation();
Map<String, String> properties = editProperties(); Map<String, String> properties = editProperties();
properties.put(Thing.PROPERTY_MODEL_ID, Integer.toString(systemInformation.getModel())); properties.put(Thing.PROPERTY_MODEL_ID, Integer.toString(systemInformation.getModel()));
properties.put(Thing.PROPERTY_FIRMWARE_VERSION, properties.put(Thing.PROPERTY_FIRMWARE_VERSION, systemInformation.getMajor() + "."
Integer.toString(systemInformation.getMajor()) + "." + systemInformation.getMinor() + "." + systemInformation.getRevision());
+ Integer.toString(systemInformation.getMinor()) + "."
+ Integer.toString(systemInformation.getRevision()));
properties.put(THING_PROPERTIES_PHONE_NUMBER, systemInformation.getPhone()); properties.put(THING_PROPERTIES_PHONE_NUMBER, systemInformation.getPhone());
updateProperties(properties); updateProperties(properties);
} catch (OmniInvalidResponseException | OmniUnknownMessageTypeException | BridgeOfflineException e) { } catch (OmniInvalidResponseException | OmniUnknownMessageTypeException | BridgeOfflineException e) {
@ -597,8 +594,7 @@ public class OmnilinkBridgeHandler extends BaseBridgeHandler implements Notifica
private void scheduleReconnectJob() { private void scheduleReconnectJob() {
ScheduledFuture<?> currentReconnectJob = connectJob; ScheduledFuture<?> currentReconnectJob = connectJob;
if (currentReconnectJob == null || currentReconnectJob.isDone()) { if (currentReconnectJob == null || currentReconnectJob.isDone()) {
connectJob = super.scheduler.scheduleWithFixedDelay(this::makeOmnilinkConnection, 0, autoReconnectPeriod, connectJob = super.scheduler.scheduleWithFixedDelay(this::makeOmnilinkConnection, 0, 60, TimeUnit.SECONDS);
TimeUnit.SECONDS);
} }
} }
@ -647,13 +643,13 @@ public class OmnilinkBridgeHandler extends BaseBridgeHandler implements Notifica
logger.debug("Processing event log message number: {}", logData.getEventNumber()); logger.debug("Processing event log message number: {}", logData.getEventNumber());
eventLogNumber = logData.getEventNumber(); eventLogNumber = logData.getEventNumber();
String json = gson.toJson(logData); String json = gson.toJson(logData);
logger.debug("Receieved event log message: {}", json); logger.debug("Received event log message: {}", json);
updateState(CHANNEL_EVENT_LOG, new StringType(json)); updateState(CHANNEL_EVENT_LOG, new StringType(json));
} }
} while (message.getMessageType() != Message.MESG_TYPE_END_OF_DATA); } while (message.getMessageType() != Message.MESG_TYPE_END_OF_DATA);
} catch (OmniInvalidResponseException | OmniUnknownMessageTypeException | BridgeOfflineException e) { } catch (OmniInvalidResponseException | OmniUnknownMessageTypeException | BridgeOfflineException e) {
logger.debug("Exception recieved while polling for event log messages: {}", e.getMessage()); logger.debug("Exception received while polling for event log messages: {}", e.getMessage());
} }
} }

View File

@ -103,7 +103,7 @@ public class TempSensorHandler extends AbstractOmnilinkStatusHandler<ExtendedAux
public void handleCommand(ChannelUID channelUID, Command command) { public void handleCommand(ChannelUID channelUID, Command command) {
logger.debug("handleCommand called for channel: {}, command: {}", channelUID, command); logger.debug("handleCommand called for channel: {}, command: {}", channelUID, command);
final OmnilinkBridgeHandler bridgeHandler = getOmnilinkBridgeHandler(); final OmnilinkBridgeHandler bridgeHandler = getOmnilinkBridgeHandler();
Optional<TemperatureFormat> temperatureFormat = Optional.empty(); Optional<TemperatureFormat> temperatureFormat;
if (command instanceof RefreshType) { if (command instanceof RefreshType) {
retrieveStatus().ifPresentOrElse(this::updateChannels, () -> updateStatus(ThingStatus.OFFLINE, retrieveStatus().ifPresentOrElse(this::updateChannels, () -> updateStatus(ThingStatus.OFFLINE,
@ -118,7 +118,7 @@ public class TempSensorHandler extends AbstractOmnilinkStatusHandler<ExtendedAux
if (bridgeHandler != null) { if (bridgeHandler != null) {
temperatureFormat = bridgeHandler.getTemperatureFormat(); temperatureFormat = bridgeHandler.getTemperatureFormat();
if (temperatureFormat.isEmpty()) { if (temperatureFormat.isEmpty()) {
logger.warn("Receieved null temperature format!"); logger.warn("Received null temperature format!");
return; return;
} }
} else { } else {
@ -158,7 +158,7 @@ public class TempSensorHandler extends AbstractOmnilinkStatusHandler<ExtendedAux
temperatureFormat.get().omniToFormat(status.getHeatSetpoint()), temperatureFormat.get().omniToFormat(status.getHeatSetpoint()),
temperatureFormat.get().getFormatNumber() == 1 ? ImperialUnits.FAHRENHEIT : SIUnits.CELSIUS)); temperatureFormat.get().getFormatNumber() == 1 ? ImperialUnits.FAHRENHEIT : SIUnits.CELSIUS));
} else { } else {
logger.warn("Receieved null temperature format, could not update Temperature Sensor channels!"); logger.warn("Received null temperature format, could not update Temperature Sensor channels!");
} }
} else { } else {
logger.debug("Received null bridge while updating Temperature Sensor channels!"); logger.debug("Received null bridge while updating Temperature Sensor channels!");

View File

@ -75,7 +75,7 @@ public class ThermostatHandler extends AbstractOmnilinkStatusHandler<ExtendedThe
private final int bit; private final int bit;
private final int modeValue; private final int modeValue;
private ThermostatStatus(int bit, int modeValue) { ThermostatStatus(int bit, int modeValue) {
this.bit = bit; this.bit = bit;
this.modeValue = modeValue; this.modeValue = modeValue;
} }
@ -122,7 +122,7 @@ public class ThermostatHandler extends AbstractOmnilinkStatusHandler<ExtendedThe
public void handleCommand(ChannelUID channelUID, Command command) { public void handleCommand(ChannelUID channelUID, Command command) {
logger.debug("handleCommand called for channel: {}, command: {}", channelUID, command); logger.debug("handleCommand called for channel: {}, command: {}", channelUID, command);
final OmnilinkBridgeHandler bridgeHandler = getOmnilinkBridgeHandler(); final OmnilinkBridgeHandler bridgeHandler = getOmnilinkBridgeHandler();
Optional<TemperatureFormat> temperatureFormat = Optional.empty(); Optional<TemperatureFormat> temperatureFormat;
if (command instanceof RefreshType) { if (command instanceof RefreshType) {
retrieveStatus().ifPresentOrElse(this::updateChannels, () -> updateStatus(ThingStatus.OFFLINE, retrieveStatus().ifPresentOrElse(this::updateChannels, () -> updateStatus(ThingStatus.OFFLINE,
@ -137,7 +137,7 @@ public class ThermostatHandler extends AbstractOmnilinkStatusHandler<ExtendedThe
if (bridgeHandler != null) { if (bridgeHandler != null) {
temperatureFormat = bridgeHandler.getTemperatureFormat(); temperatureFormat = bridgeHandler.getTemperatureFormat();
if (temperatureFormat.isEmpty()) { if (temperatureFormat.isEmpty()) {
logger.warn("Receieved null temperature format!"); logger.warn("Received null temperature format!");
return; return;
} }
} else { } else {
@ -226,7 +226,7 @@ public class ThermostatHandler extends AbstractOmnilinkStatusHandler<ExtendedThe
temperatureFormat.get().omniToFormat(status.getHeatSetpoint()), temperatureFormat.get().omniToFormat(status.getHeatSetpoint()),
temperatureFormat.get().getFormatNumber() == 1 ? ImperialUnits.FAHRENHEIT : SIUnits.CELSIUS)); temperatureFormat.get().getFormatNumber() == 1 ? ImperialUnits.FAHRENHEIT : SIUnits.CELSIUS));
} else { } else {
logger.warn("Receieved null temperature format, could not update Thermostat channels!"); logger.warn("Received null temperature format, could not update Thermostat channels!");
} }
} else { } else {
logger.warn("Could not connect to Bridge, failed to get temperature format!"); logger.warn("Could not connect to Bridge, failed to get temperature format!");

View File

@ -160,11 +160,9 @@ public class UnitHandler extends AbstractOmnilinkStatusHandler<ExtendedUnitStatu
public void updateChannels(ExtendedUnitStatus status) { public void updateChannels(ExtendedUnitStatus status) {
logger.debug("updateChannels called for Unit status: {}", status); logger.debug("updateChannels called for Unit status: {}", status);
int unitStatus = status.getStatus(); int unitStatus = status.getStatus();
int level = 0; int level = Status.UNIT_OFF;
if (unitStatus == Status.UNIT_OFF) { if (unitStatus == Status.UNIT_ON) {
level = 0;
} else if (unitStatus == Status.UNIT_ON) {
level = 100; level = 100;
} else if ((unitStatus >= Status.UNIT_SCENE_A) && (unitStatus <= Status.UNIT_SCENE_L)) { } else if ((unitStatus >= Status.UNIT_SCENE_A) && (unitStatus <= Status.UNIT_SCENE_L)) {
level = 100; level = 100;
@ -206,7 +204,7 @@ public class UnitHandler extends AbstractOmnilinkStatusHandler<ExtendedUnitStatu
/** /**
* Handle a switch press event by triggering the appropriate channel. * Handle a switch press event by triggering the appropriate channel.
* *
* @param switchPressEvent * @param switchPressEvent A switch press event to handle.
*/ */
public void handleSwitchPressEvent(SwitchPressEvent switchPressEvent) { public void handleSwitchPressEvent(SwitchPressEvent switchPressEvent) {
ChannelUID activateChannel = new ChannelUID(getThing().getUID(), TRIGGER_CHANNEL_SWITCH_PRESS_EVENT); ChannelUID activateChannel = new ChannelUID(getThing().getUID(), TRIGGER_CHANNEL_SWITCH_PRESS_EVENT);

View File

@ -81,7 +81,7 @@ public class ZoneHandler extends AbstractOmnilinkStatusHandler<ExtendedZoneStatu
final List<AreaProperties> areas = super.getAreaProperties(); final List<AreaProperties> areas = super.getAreaProperties();
if (areas != null) { if (areas != null) {
for (AreaProperties areaProperties : areas) { for (AreaProperties areaProperties : areas) {
int areaFilter = super.bitFilterForArea(areaProperties); int areaFilter = bitFilterForArea(areaProperties);
ObjectPropertyRequest<ZoneProperties> objectPropertyRequest = ObjectPropertyRequest ObjectPropertyRequest<ZoneProperties> objectPropertyRequest = ObjectPropertyRequest
.builder(bridgeHandler, ObjectPropertyRequests.ZONE, getThingNumber(), 0).selectNamed() .builder(bridgeHandler, ObjectPropertyRequests.ZONE, getThingNumber(), 0).selectNamed()
@ -115,16 +115,11 @@ public class ZoneHandler extends AbstractOmnilinkStatusHandler<ExtendedZoneStatu
return; return;
} }
switch (channelUID.getId()) { mode = switch (channelUID.getId()) {
case CHANNEL_ZONE_BYPASS: case CHANNEL_ZONE_BYPASS -> CommandMessage.CMD_SECURITY_BYPASS_ZONE;
mode = CommandMessage.CMD_SECURITY_BYPASS_ZONE; case CHANNEL_ZONE_RESTORE -> CommandMessage.CMD_SECURITY_RESTORE_ZONE;
break; default -> -1;
case CHANNEL_ZONE_RESTORE: };
mode = CommandMessage.CMD_SECURITY_RESTORE_ZONE;
break;
default:
mode = -1;
}
logger.debug("mode {} on zone {} with code {}", mode, thingID, command.toFullString()); logger.debug("mode {} on zone {} with code {}", mode, thingID, command.toFullString());
char[] code = command.toFullString().toCharArray(); char[] code = command.toFullString().toCharArray();
if (code.length != 4) { if (code.length != 4) {
@ -174,7 +169,7 @@ public class ZoneHandler extends AbstractOmnilinkStatusHandler<ExtendedZoneStatu
@Override @Override
protected void updateChannels(ExtendedZoneStatus zoneStatus) { protected void updateChannels(ExtendedZoneStatus zoneStatus) {
// 0 Secure. 1 Not ready, 3 Trouble // 0 Secure. 1 Not ready, 3 Trouble
int current = ((zoneStatus.getStatus() >> 0) & 0x03); int current = ((zoneStatus.getStatus()) & 0x03);
// 0 Secure, 1 Tripped, 2 Reset, but previously tripped // 0 Secure, 1 Tripped, 2 Reset, but previously tripped
int latched = ((zoneStatus.getStatus() >> 2) & 0x03); int latched = ((zoneStatus.getStatus() >> 2) & 0x03);
// 0 Disarmed, 1 Armed, 2 Bypass user, 3 Bypass system // 0 Disarmed, 1 Armed, 2 Bypass user, 3 Bypass system

View File

@ -49,11 +49,9 @@ public class DimmableUnitHandler extends UnitHandler {
@Override @Override
public void handleCommand(ChannelUID channelUID, Command command) { public void handleCommand(ChannelUID channelUID, Command command) {
logger.debug("handleCommand called for channel: {}, command: {}", channelUID, command); logger.debug("handleCommand called for channel: {}, command: {}", channelUID, command);
switch (channelUID.getId()) { if (CHANNEL_UNIT_LEVEL.equals(channelUID.getId())) {
case CHANNEL_UNIT_LEVEL:
handleUnitLevel(channelUID, command); handleUnitLevel(channelUID, command);
break; } else {
default:
logger.debug("Unknown channel for Dimmable Unit thing: {}", channelUID); logger.debug("Unknown channel for Dimmable Unit thing: {}", channelUID);
super.handleCommand(channelUID, command); super.handleCommand(channelUID, command);
} }

View File

@ -146,7 +146,7 @@ public class UpbRoomHandler extends UnitHandler {
param2 = ((roomNum * 6) - 3) + cmdValue - 2; param2 = ((roomNum * 6) - 3) + cmdValue - 2;
break; break;
default: default:
logger.warn("Unexpected UPB Room state: {}", Integer.toString(cmdValue)); logger.warn("Unexpected UPB Room state: {}", cmdValue);
return; return;
} }

View File

@ -55,16 +55,14 @@ public class UpbUnitHandler extends DimmableUnitHandler {
return; return;
} }
switch (channelUID.getId()) { if (CHANNEL_UPB_STATUS.equals(channelUID.getId())) {
case CHANNEL_UPB_STATUS:
if (command instanceof StringType) { if (command instanceof StringType) {
sendOmnilinkCommand(CommandMessage.CMD_UNIT_UPB_REQ_STATUS, 0, thingID); sendOmnilinkCommand(CommandMessage.CMD_UNIT_UPB_REQ_STATUS, 0, thingID);
updateState(CHANNEL_UPB_STATUS, UnDefType.UNDEF); updateState(CHANNEL_UPB_STATUS, UnDefType.UNDEF);
} else { } else {
logger.debug("Invalid command: {}, must be StringType", command); logger.debug("Invalid command: {}, must be StringType", command);
} }
break; } else {
default:
logger.debug("Unknown channel for UPB Unit thing: {}", channelUID); logger.debug("Unknown channel for UPB Unit thing: {}", channelUID);
super.handleCommand(channelUID, command); super.handleCommand(channelUID, command);
} }