Skip to content

Commit

Permalink
v2024.4.0 Dutch translations, min/max, allow intervals < 1 minute
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroenterheerdt committed Apr 2, 2024
1 parent b2dc3f9 commit 8061f08
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions custom_components/daily/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):

for platform in PLATFORMS:
coordinator.platforms.append(platform)
hass.async_add_job(
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, platform)
)

Expand Down Expand Up @@ -132,7 +132,7 @@ def __init__(
self.name = name
self.input_sensor = input_sensor
self.operation = operation
self.interval = int(interval)
self.interval = float(interval)
self.unit_of_measurement = unit_of_measurement
self.auto_reset = auto_reset
self.hass = hass
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 6 additions & 3 deletions custom_components/daily/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ async def async_step_user(self, user_input=None):
raise OperationNotFound
# check the interval
if (
not (isinstance(user_input[CONF_INTERVAL], int))
or int(user_input[CONF_INTERVAL]) <= 0
not (
isinstance(user_input[CONF_INTERVAL], int)
or isinstance(user_input[CONF_INTERVAL], float)
)
or float(user_input[CONF_INTERVAL]) <= 0.0
):
raise IntervalNotValid
self._name = user_input[CONF_NAME]
Expand Down Expand Up @@ -99,7 +102,7 @@ async def _show_config_form(self, user_input):
vol.Required(CONF_INPUT_SENSOR): str,
vol.Required(CONF_OPERATION): vol.In(VALID_OPERATIONS),
vol.Required(CONF_UNIT_OF_MEASUREMENT): str,
vol.Required(CONF_INTERVAL, default=DEFAULT_INTERVAL): int,
vol.Required(CONF_INTERVAL, default=DEFAULT_INTERVAL): float,
vol.Required(CONF_AUTO_RESET, default=DEFAULT_AUTO_RESET): bool,
}
),
Expand Down
2 changes: 1 addition & 1 deletion custom_components/daily/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
DOMAIN = "daily"
NAME = "Daily Sensor"
DOMAIN_DATA = f"{DOMAIN}_data"
VERSION = "0.4.0"
VERSION = "2024.4.0"

ISSUE_URL = "https://github.com/jeroenterheerdt/HADailySensor/issues"

Expand Down
2 changes: 1 addition & 1 deletion custom_components/daily/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"homekit": {},
"dependencies": [],
"codeowners": ["@jeroenterheerdt"],
"version": "0.4.0"
"version": "2024.4.0"
}
2 changes: 1 addition & 1 deletion custom_components/daily/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _handle_update(self, event: Event):
pass
if state_minmax_changed:
self._occurrence = datetime.now()
self.hass.add_job(self.async_update_ha_state)
self.hass.add_job(self.async_write_ha_state)
except ValueError:
_LOGGER.error(
"unable to convert to float. Please check the source sensor ({}) is available.".format(
Expand Down

0 comments on commit 8061f08

Please sign in to comment.