]> git.basschouten.com Git - openhab-addons.git/commitdiff
Thing actions: add type in @ActionInput for generic class (#17501)
authorlolodomo <lg.hc@free.fr>
Sat, 5 Oct 2024 12:49:18 +0000 (14:49 +0200)
committerGitHub <noreply@github.com>
Sat, 5 Oct 2024 12:49:18 +0000 (14:49 +0200)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.ecobee/src/main/java/org/openhab/binding/ecobee/internal/action/EcobeeActions.java
bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/action/FroniusSymoInverterActions.java
bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/action/SendMailActions.java
bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/handler/TPLinkSmartHomeActions.java
bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/action/UniFiSiteActions.java
bundles/org.openhab.binding.warmup/src/main/java/org/openhab/binding/warmup/internal/action/WarmupActions.java

index 6186fb4519c63cb67fbdac8295f94494f741c364..467f31bbc16e982ba10ca8609b3b6a79bcb8db1c 100644 (file)
@@ -152,8 +152,8 @@ public class EcobeeActions implements ThingActions {
     @RuleAction(label = "create a vacation", description = "The create vacation function creates a vacation event on the thermostat.")
     public @ActionOutput(name = "success", type = "java.lang.Boolean") Boolean createVacation(
             @ActionInput(name = "name", description = "The vacation event name. It must be unique.") @Nullable String name,
-            @ActionInput(name = "coolHoldTemp", description = "The temperature at which to set the cool vacation hold.") @Nullable QuantityType<Temperature> coolHoldTemp,
-            @ActionInput(name = "heatHoldTemp", description = "The temperature at which to set the heat vacation hold.") @Nullable QuantityType<Temperature> heatHoldTemp,
+            @ActionInput(name = "coolHoldTemp", description = "The temperature at which to set the cool vacation hold.", type = "QuantityType<Temperature>") @Nullable QuantityType<Temperature> coolHoldTemp,
+            @ActionInput(name = "heatHoldTemp", description = "The temperature at which to set the heat vacation hold.", type = "QuantityType<Temperature>") @Nullable QuantityType<Temperature> heatHoldTemp,
             @ActionInput(name = "startDateTime", description = "(opt) The start date/time in thermostat time.") @Nullable Date startDateTime,
             @ActionInput(name = "endDateTime", description = "(opt) The end date in thermostat time.") @Nullable Date endDateTime,
             @ActionInput(name = "fan", description = "(opt) The fan mode during the vacation. Values: auto, on Default: auto") @Nullable String fan,
@@ -276,8 +276,8 @@ public class EcobeeActions implements ThingActions {
      */
     @RuleAction(label = "set the thermostat into hold", description = "The set hold function sets the thermostat into a hold with the specified temperatures.")
     public @ActionOutput(name = "success", type = "java.lang.Boolean") Boolean setHold(
-            @ActionInput(name = "coolHoldTemp", description = "The temperature at which to set the cool hold.") @Nullable QuantityType<Temperature> coolHoldTemp,
-            @ActionInput(name = "heatHoldTemp", description = "The temperature at which to set the heat hold.") @Nullable QuantityType<Temperature> heatHoldTemp) {
+            @ActionInput(name = "coolHoldTemp", description = "The temperature at which to set the cool hold.", type = "QuantityType<Temperature>") @Nullable QuantityType<Temperature> coolHoldTemp,
+            @ActionInput(name = "heatHoldTemp", description = "The temperature at which to set the heat hold.", type = "QuantityType<Temperature>") @Nullable QuantityType<Temperature> heatHoldTemp) {
         if (coolHoldTemp == null || heatHoldTemp == null) {
             throw new IllegalArgumentException("hold temperatures cannot be null");
         }
@@ -297,8 +297,8 @@ public class EcobeeActions implements ThingActions {
      */
     @RuleAction(label = "set the thermostat into hold", description = "The set hold function sets the thermostat into a hold for the specified number of hours.")
     public @ActionOutput(name = "success", type = "java.lang.Boolean") Boolean setHold(
-            @ActionInput(name = "coolHoldTemp", description = "The temperature at which to set the cool hold.") @Nullable QuantityType<Temperature> coolHoldTemp,
-            @ActionInput(name = "heatHoldTemp", description = "The temperature at which to set the heat hold.") @Nullable QuantityType<Temperature> heatHoldTemp,
+            @ActionInput(name = "coolHoldTemp", description = "The temperature at which to set the cool hold.", type = "QuantityType<Temperature>") @Nullable QuantityType<Temperature> coolHoldTemp,
+            @ActionInput(name = "heatHoldTemp", description = "The temperature at which to set the heat hold.", type = "QuantityType<Temperature>") @Nullable QuantityType<Temperature> heatHoldTemp,
             @ActionInput(name = "holdHours", description = "The number of hours for the hold.") @Nullable Number holdHours) {
         if (coolHoldTemp == null || heatHoldTemp == null) {
             throw new IllegalArgumentException("hold temperatures cannot be null");
@@ -372,8 +372,8 @@ public class EcobeeActions implements ThingActions {
      */
     @RuleAction(label = "set the thermostat into hold", description = "The set hold function sets the thermostat into a hold with the specified temperature or climate ref.")
     public @ActionOutput(name = "success", type = "java.lang.Boolean") Boolean setHold(
-            @ActionInput(name = "coolHoldTemp", description = "(opt) The temperature at which to set the cool hold.") @Nullable QuantityType<Temperature> coolHoldTemp,
-            @ActionInput(name = "heatHoldTemp", description = "(opt) The temperature at which to set the heat hold.") @Nullable QuantityType<Temperature> heatHoldTemp,
+            @ActionInput(name = "coolHoldTemp", description = "(opt) The temperature at which to set the cool hold.", type = "QuantityType<Temperature>") @Nullable QuantityType<Temperature> coolHoldTemp,
+            @ActionInput(name = "heatHoldTemp", description = "(opt) The temperature at which to set the heat hold.", type = "QuantityType<Temperature>") @Nullable QuantityType<Temperature> heatHoldTemp,
             @ActionInput(name = "holdClimateRef", description = "(opt) The Climate to use as reference for setting the coolHoldTemp, heatHoldTemp and fan settings for this hold. If this value is passed the coolHoldTemp and heatHoldTemp are not required.") @Nullable String holdClimateRef,
             @ActionInput(name = "startDateTime", description = "(opt) The start date in thermostat time.") @Nullable Date startDateTime,
             @ActionInput(name = "endDateTime", description = "(opt) The end date in thermostat time.") @Nullable Date endDateTime,
index fb2e67ecb847d0d43aa012b9182f5ffb84de4ff8..e2986217b841fb8453499416828e1823527b2a2d 100644 (file)
@@ -138,7 +138,7 @@ public class FroniusSymoInverterActions implements ThingActions {
 
     @RuleAction(label = "@text/actions.force-battery-charging.label", description = "@text/actions.force-battery-charging.description")
     public void forceBatteryCharging(
-            @ActionInput(name = "power", label = "@text/actions.power.label", description = "@text/actions.power.label") QuantityType<Power> power) {
+            @ActionInput(name = "power", label = "@text/actions.power.label", description = "@text/actions.power.label", type = "QuantityType<Power>") QuantityType<Power> power) {
         FroniusSymoInverterHandler handler = this.handler;
         if (handler != null) {
             handler.forceBatteryCharging(power);
@@ -149,7 +149,7 @@ public class FroniusSymoInverterActions implements ThingActions {
     public void addForcedBatteryChargingSchedule(
             @ActionInput(name = "from", label = "@text/actions.from.label", description = "@text/actions.from.description") LocalTime from,
             @ActionInput(name = "until", label = "@text/actions.until.label", description = "@text/actions.until.description") LocalTime until,
-            @ActionInput(name = "power", label = "@text/actions.power.label", description = "@text/actions.power.label") QuantityType<Power> power) {
+            @ActionInput(name = "power", label = "@text/actions.power.label", description = "@text/actions.power.label", type = "QuantityType<Power>") QuantityType<Power> power) {
         FroniusSymoInverterHandler handler = this.handler;
         if (handler != null) {
             handler.addForcedBatteryChargingSchedule(from, until, power);
index 54b74704bd6d09244009993571bc98d588926f18..bbdf0b0e8857c19e3fee96091fdcf1375e5204f0 100644 (file)
@@ -75,7 +75,7 @@ public class SendMailActions implements ThingActions {
     public @ActionOutput(name = "success", type = "java.lang.Boolean") Boolean sendMailWithAttachments(
             @ActionInput(name = "recipient") @Nullable String recipient,
             @ActionInput(name = "subject") @Nullable String subject, @ActionInput(name = "text") @Nullable String text,
-            @ActionInput(name = "urlList") @Nullable List<String> urlList) {
+            @ActionInput(name = "urlList", type = "List<String>") @Nullable List<String> urlList) {
         if (recipient == null) {
             logger.warn("Cannot send mail as recipient is missing.");
             return false;
@@ -166,7 +166,7 @@ public class SendMailActions implements ThingActions {
             @ActionInput(name = "recipient") @Nullable String recipient,
             @ActionInput(name = "subject") @Nullable String subject,
             @ActionInput(name = "htmlContent") @Nullable String htmlContent,
-            @ActionInput(name = "urlList") @Nullable List<String> urlList) {
+            @ActionInput(name = "urlList", type = "List<String>") @Nullable List<String> urlList) {
         if (recipient == null) {
             logger.warn("Cannot send mail as recipient is missing.");
             return false;
index 45ba4b32000b91934086b977648711308c5010f1..607d982ab4208625ccdd6c5993a2c4e5b09e6471 100644 (file)
@@ -43,8 +43,7 @@ public class TPLinkSmartHomeActions implements ThingActions, ThingHandlerService
     private @Nullable SmartHomeHandler handler;
 
     @RuleAction(label = "@text/actions.tplinksmarthome.send.label", description = "@text/actions.tplinksmarthome.send.description")
-    @ActionOutput(name = "response", label = "@text/actions.tplinksmarthome.send.response.label", description = "@text/actions.tplinksmarthome.send.response.description", type = "java.lang.String")
-    public String send(
+    public @ActionOutput(name = "response", label = "@text/actions.tplinksmarthome.send.response.label", description = "@text/actions.tplinksmarthome.send.response.description", type = "java.lang.String") String send(
             @ActionInput(name = "command", label = "@text/actions.tplinksmarthome.send.command.label", description = "@text/actions.tplinksmarthome.send.command.description", type = "java.lang.String", required = true) final String command)
             throws IOException {
         if (handler instanceof SmartHomeHandler) {
index 64c8838f555a49f6056b62a9c130409908fe751a..3635b3cf1fde534edce4c20ef5d33c212af9cc14 100644 (file)
@@ -177,7 +177,8 @@ public class UniFiSiteActions implements ThingActions {
     public @ActionOutput(name = "success", type = "java.lang.Boolean") Boolean revokeVouchers(
     /* @formatter:off */
             @ActionInput(name = "voucherCodes", label = "@text/action.unifi.vouchersInputVoucherCodes.label",
-                description = "@text/action.unifi.vouchersInputVoucherCodes.description") List<String> voucherCodes) {
+                description = "@text/action.unifi.vouchersInputVoucherCodes.description",
+                type = "List<String>") List<String> voucherCodes) {
     /* @formatter:on */
         UniFiSiteThingHandler handler = this.handler;
         if (handler == null) {
index 964127926e6de41cd168750f460f7168e6f13f08..862c6e5efddfd59eebf448391ea2d2872c54b763 100644 (file)
@@ -56,8 +56,8 @@ public class WarmupActions implements ThingActions {
 
     @RuleAction(label = "override", description = "Overrides the thermostat state for a specified time")
     public void setOverride(
-            @ActionInput(name = "temperature", label = "Temperature") @Nullable QuantityType<Temperature> temperature,
-            @ActionInput(name = "duration", label = "Duration") @Nullable QuantityType<Time> duration) {
+            @ActionInput(name = "temperature", label = "Temperature", type = "QuantityType<Temperature>") @Nullable QuantityType<Temperature> temperature,
+            @ActionInput(name = "duration", label = "Duration", type = "QuantityType<Time>") @Nullable QuantityType<Time> duration) {
         logger.debug("setOverride action called");
         RoomHandler handler = this.handler;
         if (handler != null && temperature != null && duration != null) {