diff --git a/custom_components/smart_irrigation/__init__.py b/custom_components/smart_irrigation/__init__.py index 55ff845c..33ad7c49 100644 --- a/custom_components/smart_irrigation/__init__.py +++ b/custom_components/smart_irrigation/__init__.py @@ -947,19 +947,21 @@ def calculate_module(self, zone, weatherdata, forecastdata): "module.calculation.explanation.duration-after-maximum-duration-is", self.hass.config.language, ) + " {}".format(round(duration)) - duration = round(zone.get(const.ZONE_LEAD_TIME) + duration) - explanation += ( - "
  • " - + localize( - "module.calculation.explanation.lead-time-is-applied", - self.hass.config.language, + # add the lead time but only if duration is > 0 at this point + if duration > 0.0: + duration = round(zone.get(const.ZONE_LEAD_TIME) + duration) + explanation += ( + "
  • " + + localize( + "module.calculation.explanation.lead-time-is-applied", + self.hass.config.language, + ) + + " {}, ".format(zone.get(const.ZONE_LEAD_TIME)) ) - + " {}, ".format(zone.get(const.ZONE_LEAD_TIME)) - ) - explanation += localize( - "module.calculation.explanation.duration-after-lead-time-is", - self.hass.config.language, - ) + " {}
  • ".format(duration) + explanation += localize( + "module.calculation.explanation.duration-after-lead-time-is", + self.hass.config.language, + ) + " {}".format(duration) else: # no need to irrigate, set duration to 0 duration = 0 @@ -1312,6 +1314,7 @@ async def async_update_zone_config(self, zone_id: int = None, data: dict = {}): new_bucket_value = res[const.ZONE_MAXIMUM_BUCKET] data[const.ZONE_BUCKET] = new_bucket_value data.pop(const.ATTR_SET_BUCKET) + self.store.async_update_zone(zone_id, data) async_dispatcher_send(self.hass, const.DOMAIN + "_config_updated", zone_id) elif const.ATTR_RESET_ALL_BUCKETS in data: diff --git a/custom_components/smart_irrigation/const.py b/custom_components/smart_irrigation/const.py index f8d54d88..e2311f26 100644 --- a/custom_components/smart_irrigation/const.py +++ b/custom_components/smart_irrigation/const.py @@ -1,7 +1,7 @@ """Store constants.""" -VERSION = "v2024.4.3" +VERSION = "v2024.4.4" NAME = "Smart Irrigation" MANUFACTURER = "@jeroenterheerdt" diff --git a/custom_components/smart_irrigation/frontend/dist/smart-irrigation.js b/custom_components/smart_irrigation/frontend/dist/smart-irrigation.js index c0e5e552..83247d0b 100644 --- a/custom_components/smart_irrigation/frontend/dist/smart-irrigation.js +++ b/custom_components/smart_irrigation/frontend/dist/smart-irrigation.js @@ -1057,7 +1057,7 @@ a.version="2.29.4",i(Wa),a.fn=us,a.min=Xa,a.max=Ja,a.now=Qa,a.utc=p,a.unix=cs,a. .narrow=${this.narrow} >
    ${hi("title",this.hass.language)}
    -
    ${"v2024.4.3"}
    +
    ${"v2024.4.4"}
    ZoneEntry: # apply maximum bucket value if ( ZONE_MAXIMUM_BUCKET in changes + and changes[ZONE_BUCKET] is not None and changes[ZONE_BUCKET] > changes[ZONE_MAXIMUM_BUCKET] ): changes[ZONE_BUCKET] = changes[ZONE_MAXIMUM_BUCKET]