]> git.basschouten.com Git - openhab-addons.git/commitdiff
[ecowatt] Add channels for D+2 and D+3 (#13823)
authorlolodomo <lg.hc@free.fr>
Sun, 4 Dec 2022 15:32:26 +0000 (16:32 +0100)
committerGitHub <noreply@github.com>
Sun, 4 Dec 2022 15:32:26 +0000 (16:32 +0100)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.ecowatt/src/main/java/org/openhab/binding/ecowatt/internal/EcowattBindingConstants.java
bundles/org.openhab.binding.ecowatt/src/main/java/org/openhab/binding/ecowatt/internal/handler/EcowattHandler.java
bundles/org.openhab.binding.ecowatt/src/main/resources/OH-INF/i18n/ecowatt.properties
bundles/org.openhab.binding.ecowatt/src/main/resources/OH-INF/thing/thing-types.xml

index 91f35dae9d8928c2c2ce404e14d9db7b7c167904..9341de0a5abaa6c2d72580854b7ba3172424c742 100644 (file)
@@ -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";
 }
index fdfad37ed17cd7bbb2f29c940807f94fa6f1bec1..b151a2df514b7631d9aafb2b9883014c4fc7b7a6 100644 (file)
@@ -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));
index adff546876163ce8b4bbebb150defde2fc3b38c9..1fd5645d20df3b1b7a9a169211f7eaa012952afc 100644 (file)
@@ -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
index 6b98bd383c0ee723b309c934c6559dafbd046167..b1d7b43504dbc31d82160d9976d8d6b9c9f5376e 100644 (file)
                                        consumption
                                        (green), 2 for strained electrical system (orange) and 3 for very strained electrical system (red).</description>
                        </channel>
+                       <channel id="inTwoDaysSignal" typeId="signal">
+                               <label>In Two Days Signal</label>
+                               <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).</description>
+                       </channel>
+                       <channel id="inThreeDaysSignal" typeId="signal">
+                               <label>In Three Days Signal</label>
+                               <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).</description>
+                       </channel>
                        <channel id="currentHourSignal" typeId="signal">
                                <label>Current Hour Signal</label>
                                <description>The signal relating to the forecast consumption level for the current hour. Values are 1 for normal