try {
if (checkBridgeHandler() != null) {
if (command instanceof RefreshType) {
- internalPoll();
+ internalForcePoll();
} else if (!internalHandleCommand(channelUID.getIdWithoutGroup(), command)) {
logger.debug("Unexpected command {} on channel {}", command, channelUID.getId());
}
protected abstract void internalPoll() throws FreeboxException;
+ protected void internalForcePoll() throws FreeboxException {
+ internalPoll();
+ }
+
private void updateIfActive(String group, String channelId, State state) {
ChannelUID id = new ChannelUID(getThing().getUID(), group, channelId);
if (isLinked(id)) {
pushSubscribed = getManager(WebSocketManager.class).registerListener(host.getMac(), this);
}
+ @Override
+ protected void internalForcePoll() throws FreeboxException {
+ LanHost host = getLanHost();
+ updateConnectivityChannels(host);
+ }
+
protected LanHost getLanHost() throws FreeboxException {
return getManager(LanBrowserManager.class).getHost(getMac()).map(hostIntf -> hostIntf.host())
.orElseThrow(() -> new FreeboxException("Host data not found"));
}
}
+ @Override
+ protected void internalForcePoll() throws FreeboxException {
+ super.internalForcePoll();
+
+ logger.debug("Polling Virtual machine status");
+ VirtualMachine vm = getManager(VmManager.class).getDevice(getClientId());
+ updateVmChannels(vm);
+ }
+
public void updateVmChannels(VirtualMachine vm) {
boolean running = Status.RUNNING.equals(vm.status());
updateChannelOnOff(VM_STATUS, STATUS, running);