1
0
mirror of https://github.com/home-assistant/core.git synced 2026-02-23 11:26:46 +00:00
Files
core/tests/components
Tsvi Mostovicz eac2388d49 Set default value for input_datetime (#21919)
* Set default value for input_datetime

If no initial value is set and no value is available to be restored, set the default value as specified in the docs to 1970-01-01 00:00.

* Use regular if statement

Ternary statements can be tricky if you try to keep the value the same if not something

* Add test for default values

Check that if no initial value is set, state returns 1970-01-01 at 00:00

* Fix tests - was passing wrong args to time/date

* Verify we get a timestamp attribute for input_datetime

This adds a check that when using the default timestamp of 1970-1-1 00:00:00, we
get a timestamp attribute. This is waht prompted this PR in the first place, as
when specifying an automation trying to access the timestamp attribute for a non-
initialized input_datetime HASS wouldn't start.

* Simplify the change for a default value

Based on @balloob comment. Simplifying the code

* Revert "Simplify the change for a default value"

This reverts commit c2d67f19a6.
2019-04-18 21:00:35 -07:00
..
2019-02-05 19:31:15 -08:00
2019-03-10 19:55:36 -07:00
2019-03-27 20:36:13 -07:00
2019-04-14 16:59:06 -07:00
2019-04-14 16:59:06 -07:00
2019-03-27 20:36:13 -07:00
2019-03-23 20:22:35 -07:00
2019-04-08 23:16:55 -07:00
2019-03-27 20:36:13 -07:00
2019-04-14 22:31:01 -07:00
2019-04-14 16:59:06 -07:00
2019-04-14 16:59:06 -07:00
2019-04-08 23:16:55 -07:00
2019-04-08 23:16:55 -07:00
2019-04-09 13:59:15 -07:00
2019-03-27 20:36:13 -07:00
2019-04-08 23:16:55 -07:00
2019-03-10 19:55:36 -07:00
2019-02-05 19:31:15 -08:00
2019-04-08 23:16:55 -07:00
2019-04-14 16:59:06 -07:00
2019-03-26 07:34:16 -07:00
2019-02-05 19:31:15 -08:00
2019-03-27 20:36:13 -07:00
2019-04-15 16:45:46 -07:00
2019-02-05 19:31:15 -08:00
2019-04-09 13:59:15 -07:00
2019-03-19 06:43:15 -07:00
2019-03-27 20:36:13 -07:00
2019-03-13 10:17:09 +01:00
2019-02-05 19:31:15 -08:00
2019-03-30 21:10:32 -07:00
2019-04-07 12:42:16 -07:00
2019-02-05 19:31:15 -08:00
2019-02-26 10:18:09 -08:00
2019-04-08 23:16:55 -07:00
2019-03-26 07:34:16 -07:00
2019-03-26 07:34:16 -07:00
2019-03-26 07:34:16 -07:00
2019-03-27 20:36:13 -07:00
2019-03-27 19:50:52 -07:00
2019-04-14 16:59:06 -07:00