From c4b76a0ad11d5098f0f48bb3f86b0f943afc23cf Mon Sep 17 00:00:00 2001 From: Christoph Weitkamp Date: Wed, 7 Oct 2020 22:03:15 +0200 Subject: [PATCH] Added action for 'isBankHoliday()' (#1703) Signed-off-by: Christoph Weitkamp --- .../core/model/script/actions/Ephemeris.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/bundles/org.openhab.core.model.script/src/org/openhab/core/model/script/actions/Ephemeris.java b/bundles/org.openhab.core.model.script/src/org/openhab/core/model/script/actions/Ephemeris.java index 5626ed3b9d1..054b604b5ee 100644 --- a/bundles/org.openhab.core.model.script/src/org/openhab/core/model/script/actions/Ephemeris.java +++ b/bundles/org.openhab.core.model.script/src/org/openhab/core/model/script/actions/Ephemeris.java @@ -60,27 +60,32 @@ public static boolean isInDayset(String daysetName, ZonedDateTime day) { return EphemerisActionService.ephemerisManager.isInDayset(daysetName, day); } - @ActionDoc(text = "checks if today is bank holiday") + @ActionDoc(text = "checks if today is a bank holiday") public static boolean isBankHoliday() { return isBankHoliday(0); } - @ActionDoc(text = "checks if today plus or minus a given offset is bank holiday") + @ActionDoc(text = "checks if today plus or minus a given offset is a bank holiday") public static boolean isBankHoliday(int offset) { return isBankHoliday(ZonedDateTime.now().plusDays(offset)); } - @ActionDoc(text = "checks a given day is bank holiday") + @ActionDoc(text = "checks a given day is a bank holiday") public static boolean isBankHoliday(ZonedDateTime day) { return EphemerisActionService.ephemerisManager.isBankHoliday(day); } - @ActionDoc(text = "checks if today plus or minus a given offset is bank holiday from a given userfile") + @ActionDoc(text = "checks if today is a bank holiday from a given userfile") + public static boolean isBankHoliday(String filename) { + return isBankHoliday(0, filename); + } + + @ActionDoc(text = "checks if today plus or minus a given offset is a bank holiday from a given userfile") public static boolean isBankHoliday(int offset, String filename) { return isBankHoliday(ZonedDateTime.now().plusDays(offset), filename); } - @ActionDoc(text = "checks a given day is bank holiday from a given userfile") + @ActionDoc(text = "checks a given day is a bank holiday from a given userfile") public static boolean isBankHoliday(ZonedDateTime day, String filename) { try { return EphemerisActionService.ephemerisManager.isBankHoliday(day, filename);