mirror of
https://github.com/home-assistant/core.git
synced 2025-05-03 13:39:16 +00:00

* 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 c2d67f19a686b141672d619be62e3f53890f1328.