Skip to content

Commit 8061f08

Browse files
v2024.4.0 Dutch translations, min/max, allow intervals < 1 minute
1 parent b2dc3f9 commit 8061f08

File tree

10 files changed

+11
-8
lines changed

10 files changed

+11
-8
lines changed

custom_components/daily/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
6767

6868
for platform in PLATFORMS:
6969
coordinator.platforms.append(platform)
70-
hass.async_add_job(
70+
hass.async_create_task(
7171
hass.config_entries.async_forward_entry_setup(entry, platform)
7272
)
7373

@@ -132,7 +132,7 @@ def __init__(
132132
self.name = name
133133
self.input_sensor = input_sensor
134134
self.operation = operation
135-
self.interval = int(interval)
135+
self.interval = float(interval)
136136
self.unit_of_measurement = unit_of_measurement
137137
self.auto_reset = auto_reset
138138
self.hass = hass
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

custom_components/daily/config_flow.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ async def async_step_user(self, user_input=None):
5454
raise OperationNotFound
5555
# check the interval
5656
if (
57-
not (isinstance(user_input[CONF_INTERVAL], int))
58-
or int(user_input[CONF_INTERVAL]) <= 0
57+
not (
58+
isinstance(user_input[CONF_INTERVAL], int)
59+
or isinstance(user_input[CONF_INTERVAL], float)
60+
)
61+
or float(user_input[CONF_INTERVAL]) <= 0.0
5962
):
6063
raise IntervalNotValid
6164
self._name = user_input[CONF_NAME]
@@ -99,7 +102,7 @@ async def _show_config_form(self, user_input):
99102
vol.Required(CONF_INPUT_SENSOR): str,
100103
vol.Required(CONF_OPERATION): vol.In(VALID_OPERATIONS),
101104
vol.Required(CONF_UNIT_OF_MEASUREMENT): str,
102-
vol.Required(CONF_INTERVAL, default=DEFAULT_INTERVAL): int,
105+
vol.Required(CONF_INTERVAL, default=DEFAULT_INTERVAL): float,
103106
vol.Required(CONF_AUTO_RESET, default=DEFAULT_AUTO_RESET): bool,
104107
}
105108
),

custom_components/daily/const.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
DOMAIN = "daily"
44
NAME = "Daily Sensor"
55
DOMAIN_DATA = f"{DOMAIN}_data"
6-
VERSION = "0.4.0"
6+
VERSION = "2024.4.0"
77

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

custom_components/daily/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"homekit": {},
1111
"dependencies": [],
1212
"codeowners": ["@jeroenterheerdt"],
13-
"version": "0.4.0"
13+
"version": "2024.4.0"
1414
}

custom_components/daily/sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def _handle_update(self, event: Event):
139139
pass
140140
if state_minmax_changed:
141141
self._occurrence = datetime.now()
142-
self.hass.add_job(self.async_update_ha_state)
142+
self.hass.add_job(self.async_write_ha_state)
143143
except ValueError:
144144
_LOGGER.error(
145145
"unable to convert to float. Please check the source sensor ({}) is available.".format(

0 commit comments

Comments
 (0)