mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-25 14:55:55 +01:00
Fix smart water alert level. (#11734)
Signed-off-by: Stewart Cossey <stewart.cossey@gmail.com>
This commit is contained in:
parent
dc11890f32
commit
85929a1d31
@ -36,7 +36,7 @@ public class SmartWater implements WaterWebService {
|
||||
private static final String REGION_WAIKATO = "/alert-levels/waikato-district-council";
|
||||
private static final String REGION_WAIPA = "/alert-levels/waipa-district-council";
|
||||
|
||||
private static final String PATTERN = "/assets/Alert-Level-Images/water-alert-([1-4]|no)-large.svg.*?";
|
||||
private static final String PATTERN = "/assets/Alert-Level-Images/(?:water-alert-([1-4]|no)-large|(save)-wai-logo).svg.*?";
|
||||
private static final Pattern REGEX = Pattern.compile(PATTERN,
|
||||
Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL);
|
||||
|
||||
@ -66,8 +66,10 @@ public class SmartWater implements WaterWebService {
|
||||
|
||||
while (matches.find()) {
|
||||
String level = matches.group(1);
|
||||
final String altMsgs = matches.group(2);
|
||||
|
||||
logger.debug("Data Level {}", level);
|
||||
if (level.equalsIgnoreCase("no")) {
|
||||
if ("no".equalsIgnoreCase(level) || "save".equalsIgnoreCase(altMsgs)) {
|
||||
logger.debug("Convert Data Level to 0");
|
||||
level = "0";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user