[datetime] Fix templated args (#7368)
Some checks are pending
CI / Create common environment (push) Waiting to run
CI / Check black (push) Blocked by required conditions
CI / Check flake8 (push) Blocked by required conditions
CI / Check pylint (push) Blocked by required conditions
CI / Check pyupgrade (push) Blocked by required conditions
CI / Run script/ci-custom (push) Blocked by required conditions
CI / Run pytest (macOS-latest, 3.11) (push) Blocked by required conditions
CI / Run pytest (ubuntu-latest, 3.10) (push) Blocked by required conditions
CI / Run pytest (ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Run pytest (ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Run pytest (ubuntu-latest, 3.9) (push) Blocked by required conditions
CI / Run pytest (windows-latest, 3.11) (push) Blocked by required conditions
CI / Check clang-format (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 Arduino 1/4 (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 Arduino 2/4 (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 Arduino 3/4 (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 Arduino 4/4 (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP32 IDF (push) Blocked by required conditions
CI / Run script/clang-tidy for ESP8266 (push) Blocked by required conditions
CI / list-components (push) Blocked by required conditions
CI / Component test ${{ matrix.file }} (push) Blocked by required conditions
CI / Split components for testing into 20 groups maximum (push) Blocked by required conditions
CI / Test split components (push) Blocked by required conditions
CI / CI Status (push) Blocked by required conditions

This commit is contained in:
Jesse Hills 2024-08-29 05:07:31 +12:00 committed by GitHub
parent d6df466237
commit 4b2032a98e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -186,7 +186,7 @@ async def datetime_date_set_to_code(config, action_id, template_arg, args):
date_config = config[CONF_DATE] date_config = config[CONF_DATE]
if cg.is_template(date_config): if cg.is_template(date_config):
template_ = await cg.templatable(date_config, [], cg.ESPTime) template_ = await cg.templatable(date_config, args, cg.ESPTime)
cg.add(action_var.set_date(template_)) cg.add(action_var.set_date(template_))
else: else:
date_struct = cg.StructInitializer( date_struct = cg.StructInitializer(
@ -217,7 +217,7 @@ async def datetime_time_set_to_code(config, action_id, template_arg, args):
time_config = config[CONF_TIME] time_config = config[CONF_TIME]
if cg.is_template(time_config): if cg.is_template(time_config):
template_ = await cg.templatable(time_config, [], cg.ESPTime) template_ = await cg.templatable(time_config, args, cg.ESPTime)
cg.add(action_var.set_time(template_)) cg.add(action_var.set_time(template_))
else: else:
time_struct = cg.StructInitializer( time_struct = cg.StructInitializer(
@ -248,7 +248,7 @@ async def datetime_datetime_set_to_code(config, action_id, template_arg, args):
datetime_config = config[CONF_DATETIME] datetime_config = config[CONF_DATETIME]
if cg.is_template(datetime_config): if cg.is_template(datetime_config):
template_ = await cg.templatable(datetime_config, [], cg.ESPTime) template_ = await cg.templatable(datetime_config, args, cg.ESPTime)
cg.add(action_var.set_datetime(template_)) cg.add(action_var.set_datetime(template_))
else: else:
datetime_struct = cg.StructInitializer( datetime_struct = cg.StructInitializer(