mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-29 12:34:21 +02:00
[tuya] Handle RefreshType requests on Channels (#18655)
Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
This commit is contained in:
+9
@@ -67,6 +67,7 @@ import org.openhab.core.thing.binding.builder.ThingBuilder;
|
||||
import org.openhab.core.thing.type.ChannelTypeUID;
|
||||
import org.openhab.core.types.Command;
|
||||
import org.openhab.core.types.CommandOption;
|
||||
import org.openhab.core.types.RefreshType;
|
||||
import org.openhab.core.types.State;
|
||||
import org.openhab.core.types.UnDefType;
|
||||
import org.slf4j.Logger;
|
||||
@@ -258,6 +259,14 @@ public class TuyaDeviceHandler extends BaseThingHandler implements DeviceInfoSub
|
||||
return;
|
||||
}
|
||||
|
||||
if (command instanceof RefreshType) {
|
||||
State state = channelStateCache.get(channelUID.getId());
|
||||
if (state != null) {
|
||||
updateState(channelUID, state);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Map<Integer, @Nullable Object> commandRequest = new HashMap<>();
|
||||
|
||||
ChannelTypeUID channelTypeUID = channelIdToChannelTypeUID.get(channelUID.getId());
|
||||
|
||||
Reference in New Issue
Block a user