[tuya] Handle RefreshType requests on Channels (#18655)

Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
This commit is contained in:
mjagdis
2025-05-06 18:29:40 +02:00
committed by GitHub
parent 0d9842eda7
commit 684c724fdc
@@ -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());