* input_datetime guard for unexpected state
If state is a time and has_date = true, or the other way around, restore state would error
* Update __init__.py
* Add test
* Refactor input_datetime.
Keep the state as datetime, but format accordingly to has_time and
has_date.
* Use config dict for input_datetime.
* Add tests.
* Lint
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Store last working HTTP settings
* Add safe mode
* Fix tests
* Add cloud to safe mode
* Update logging text
* Fix camera tests leaving files behind
* Make emulated_hue tests not leave files behind
* Make logbook tests not leave files behind
* Make tts tests not leave files behind
* Make image_processing tests not leave files behind
* Make manual_mqtt tests not leave files behind
* 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.