From 3a4a3879311041d813bc396b595d977bc3aedf47 Mon Sep 17 00:00:00 2001 From: Jacob Laursen Date: Wed, 28 Dec 2022 19:20:29 +0100 Subject: [PATCH] Remove deprecated channel (#14030) Signed-off-by: Jacob Laursen --- .../danfossairunit/internal/Channel.java | 3 --- .../handler/DanfossAirUnitHandler.java | 18 ------------------ .../OH-INF/i18n/danfossairunit.properties | 2 -- .../resources/OH-INF/thing/thing-types.xml | 4 ---- 4 files changed, 27 deletions(-) diff --git a/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/Channel.java b/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/Channel.java index 0207a0d82..5b4bd42e9 100644 --- a/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/Channel.java +++ b/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/Channel.java @@ -28,9 +28,6 @@ public enum Channel { CHANNEL_CURRENT_TIME("current_time", ChannelGroup.MAIN, DanfossAirUnit::getCurrentTime), CHANNEL_MODE("mode", ChannelGroup.MAIN, DanfossAirUnit::getMode, DanfossAirUnit::setMode), - // Backwards compatibility as channel was renamed from manual_fan_speed to manual_fan_step. - CHANNEL_MANUAL_FAN_SPEED("manual_fan_speed", ChannelGroup.MAIN, DanfossAirUnit::getManualFanStep, - DanfossAirUnit::setManualFanStep), CHANNEL_MANUAL_FAN_STEP("manual_fan_step", ChannelGroup.MAIN, DanfossAirUnit::getManualFanStep, DanfossAirUnit::setManualFanStep), CHANNEL_EXTRACT_FAN_SPEED("extract_fan_speed", ChannelGroup.MAIN, DanfossAirUnit::getExtractFanSpeed), diff --git a/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/handler/DanfossAirUnitHandler.java b/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/handler/DanfossAirUnitHandler.java index f815e3c84..4acc55d22 100644 --- a/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/handler/DanfossAirUnitHandler.java +++ b/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/handler/DanfossAirUnitHandler.java @@ -23,14 +23,12 @@ import java.util.concurrent.TimeUnit; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.danfossairunit.internal.Channel; -import org.openhab.binding.danfossairunit.internal.ChannelGroup; import org.openhab.binding.danfossairunit.internal.DanfossAirUnit; import org.openhab.binding.danfossairunit.internal.DanfossAirUnitCommunicationController; import org.openhab.binding.danfossairunit.internal.DanfossAirUnitConfiguration; import org.openhab.binding.danfossairunit.internal.DanfossAirUnitWriteAccessor; import org.openhab.binding.danfossairunit.internal.UnexpectedResponseValueException; import org.openhab.binding.danfossairunit.internal.ValueCache; -import org.openhab.core.thing.ChannelGroupUID; import org.openhab.core.thing.ChannelUID; import org.openhab.core.thing.Thing; import org.openhab.core.thing.ThingStatus; @@ -99,7 +97,6 @@ public class DanfossAirUnitHandler extends BaseThingHandler { updateStatus(ThingStatus.UNKNOWN); config = getConfigAs(DanfossAirUnitConfiguration.class); valueCache = new ValueCache(config.updateUnchangedValuesEveryMillis); - removeDeprecatedChannels(); try { var localCommunicationController = new DanfossAirUnitCommunicationController( InetAddress.getByName(config.host), TCP_PORT); @@ -113,21 +110,6 @@ public class DanfossAirUnitHandler extends BaseThingHandler { } } - private void removeDeprecatedChannels() { - ChannelGroupUID mainChannelGroupUid = new ChannelGroupUID(thing.getUID(), ChannelGroup.MAIN.getGroupName()); - ChannelUID manualFanSpeedChannelUid = new ChannelUID(mainChannelGroupUid, - Channel.CHANNEL_MANUAL_FAN_SPEED.getChannelName()); - if (this.isLinked(manualFanSpeedChannelUid)) { - ChannelUID manualFanStepChannelUid = new ChannelUID(mainChannelGroupUid, - Channel.CHANNEL_MANUAL_FAN_STEP.getChannelName()); - logger.warn("Channel '{}' is deprecated, please use '{}' instead.", manualFanSpeedChannelUid, - manualFanStepChannelUid); - } else { - logger.debug("Removing deprecated unlinked channel '{}'.", manualFanSpeedChannelUid); - updateThing(editThing().withoutChannel(manualFanSpeedChannelUid).build()); - } - } - private void updateAllChannels() { if (!initializeProperties()) { return; diff --git a/bundles/org.openhab.binding.danfossairunit/src/main/resources/OH-INF/i18n/danfossairunit.properties b/bundles/org.openhab.binding.danfossairunit/src/main/resources/OH-INF/i18n/danfossairunit.properties index 758c160b5..708caf99c 100644 --- a/bundles/org.openhab.binding.danfossairunit/src/main/resources/OH-INF/i18n/danfossairunit.properties +++ b/bundles/org.openhab.binding.danfossairunit/src/main/resources/OH-INF/i18n/danfossairunit.properties @@ -25,8 +25,6 @@ channel-group-type.danfossairunit.humidity.channel.humidity.description = Curren channel-group-type.danfossairunit.main.label = Mode and Fan Speeds channel-group-type.danfossairunit.main.channel.boost.label = Boost channel-group-type.danfossairunit.main.channel.boost.description = Enables fan boost -channel-group-type.danfossairunit.main.channel.manual_fan_speed.label = Manual Fan Speed -channel-group-type.danfossairunit.main.channel.manual_fan_speed.description = Deprecated, please use Manual Fan Step instead. This channel will be removed in a later version. channel-group-type.danfossairunit.main.channel.night_cooling.label = Night Cooling channel-group-type.danfossairunit.main.channel.night_cooling.description = Enables night cooling channel-group-type.danfossairunit.recuperator.label = Recuperator diff --git a/bundles/org.openhab.binding.danfossairunit/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.danfossairunit/src/main/resources/OH-INF/thing/thing-types.xml index 748f9eaa3..3c9a3ce13 100644 --- a/bundles/org.openhab.binding.danfossairunit/src/main/resources/OH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.danfossairunit/src/main/resources/OH-INF/thing/thing-types.xml @@ -50,10 +50,6 @@ - - - Deprecated, please use Manual Fan Step instead. This channel will be removed in a later version. -