From: lolodomo Date: Sun, 4 Dec 2022 15:32:26 +0000 (+0100) Subject: [ecowatt] Add channels for D+2 and D+3 (#13823) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=7cbae110a024423f370f8f5e8524845b6f9d604a;p=openhab-addons.git [ecowatt] Add channels for D+2 and D+3 (#13823) Signed-off-by: Laurent Garnier --- diff --git a/bundles/org.openhab.binding.ecowatt/src/main/java/org/openhab/binding/ecowatt/internal/EcowattBindingConstants.java b/bundles/org.openhab.binding.ecowatt/src/main/java/org/openhab/binding/ecowatt/internal/EcowattBindingConstants.java index 91f35dae9d..9341de0a5a 100644 --- a/bundles/org.openhab.binding.ecowatt/src/main/java/org/openhab/binding/ecowatt/internal/EcowattBindingConstants.java +++ b/bundles/org.openhab.binding.ecowatt/src/main/java/org/openhab/binding/ecowatt/internal/EcowattBindingConstants.java @@ -32,5 +32,7 @@ public class EcowattBindingConstants { // List of all Channel ids public static final String CHANNEL_TODAY_SIGNAL = "todaySignal"; public static final String CHANNEL_TOMORROW_SIGNAL = "tomorrowSignal"; + public static final String CHANNEL_IN_TWO_DAYS_SIGNAL = "inTwoDaysSignal"; + public static final String CHANNEL_IN_THREE_DAYS_SIGNAL = "inThreeDaysSignal"; public static final String CHANNEL_CURRENT_HOUR_SIGNAL = "currentHourSignal"; } diff --git a/bundles/org.openhab.binding.ecowatt/src/main/java/org/openhab/binding/ecowatt/internal/handler/EcowattHandler.java b/bundles/org.openhab.binding.ecowatt/src/main/java/org/openhab/binding/ecowatt/internal/handler/EcowattHandler.java index fdfad37ed1..b151a2df51 100644 --- a/bundles/org.openhab.binding.ecowatt/src/main/java/org/openhab/binding/ecowatt/internal/handler/EcowattHandler.java +++ b/bundles/org.openhab.binding.ecowatt/src/main/java/org/openhab/binding/ecowatt/internal/handler/EcowattHandler.java @@ -212,6 +212,14 @@ public class EcowattHandler extends BaseThingHandler { if ((channelId == null || CHANNEL_TOMORROW_SIGNAL.equals(channelId)) && isLinked(CHANNEL_TOMORROW_SIGNAL)) { updateState(CHANNEL_TOMORROW_SIGNAL, getDaySignalState(response, now.plusDays(1))); } + if ((channelId == null || CHANNEL_IN_TWO_DAYS_SIGNAL.equals(channelId)) + && isLinked(CHANNEL_IN_TWO_DAYS_SIGNAL)) { + updateState(CHANNEL_IN_TWO_DAYS_SIGNAL, getDaySignalState(response, now.plusDays(2))); + } + if ((channelId == null || CHANNEL_IN_THREE_DAYS_SIGNAL.equals(channelId)) + && isLinked(CHANNEL_IN_THREE_DAYS_SIGNAL)) { + updateState(CHANNEL_IN_THREE_DAYS_SIGNAL, getDaySignalState(response, now.plusDays(3))); + } if ((channelId == null || CHANNEL_CURRENT_HOUR_SIGNAL.equals(channelId)) && isLinked(CHANNEL_CURRENT_HOUR_SIGNAL)) { updateState(CHANNEL_CURRENT_HOUR_SIGNAL, getHourSignalState(response, now)); diff --git a/bundles/org.openhab.binding.ecowatt/src/main/resources/OH-INF/i18n/ecowatt.properties b/bundles/org.openhab.binding.ecowatt/src/main/resources/OH-INF/i18n/ecowatt.properties index adff546876..1fd5645d20 100644 --- a/bundles/org.openhab.binding.ecowatt/src/main/resources/OH-INF/i18n/ecowatt.properties +++ b/bundles/org.openhab.binding.ecowatt/src/main/resources/OH-INF/i18n/ecowatt.properties @@ -9,6 +9,10 @@ thing-type.ecowatt.signals.label = Electricity Forecast thing-type.ecowatt.signals.description = The French electricity consumption forecasts thing-type.ecowatt.signals.channel.currentHourSignal.label = Current Hour Signal thing-type.ecowatt.signals.channel.currentHourSignal.description = The signal relating to the forecast consumption level for the current hour. Values are 1 for normal consumption (green), 2 for strained electrical system (orange) and 3 for very strained electrical system (red). +thing-type.ecowatt.signals.channel.inThreeDaysSignal.label = In Three Days Signal +thing-type.ecowatt.signals.channel.inThreeDaysSignal.description = The signal relating to the forecast consumption level in three days. Values are 1 for normal consumption (green), 2 for strained electrical system (orange) and 3 for very strained electrical system (red). +thing-type.ecowatt.signals.channel.inTwoDaysSignal.label = In Two Days Signal +thing-type.ecowatt.signals.channel.inTwoDaysSignal.description = The signal relating to the forecast consumption level in two days. Values are 1 for normal consumption (green), 2 for strained electrical system (orange) and 3 for very strained electrical system (red). thing-type.ecowatt.signals.channel.todaySignal.label = Today Signal thing-type.ecowatt.signals.channel.todaySignal.description = The signal relating to the forecast consumption level for today. Values are 1 for normal consumption (green), 2 for strained electrical system (orange) and 3 for very strained electrical system (red). thing-type.ecowatt.signals.channel.tomorrowSignal.label = Tomorrow Signal diff --git a/bundles/org.openhab.binding.ecowatt/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.ecowatt/src/main/resources/OH-INF/thing/thing-types.xml index 6b98bd383c..b1d7b43504 100644 --- a/bundles/org.openhab.binding.ecowatt/src/main/resources/OH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.ecowatt/src/main/resources/OH-INF/thing/thing-types.xml @@ -20,6 +20,18 @@ consumption (green), 2 for strained electrical system (orange) and 3 for very strained electrical system (red). + + + The signal relating to the forecast consumption level in two days. Values are 1 for normal + consumption + (green), 2 for strained electrical system (orange) and 3 for very strained electrical system (red). + + + + The signal relating to the forecast consumption level in three days. Values are 1 for normal + consumption + (green), 2 for strained electrical system (orange) and 3 for very strained electrical system (red). + The signal relating to the forecast consumption level for the current hour. Values are 1 for normal