* Add yamllint (in pre-commit and CI)
* Fix linting for all YAML files
* Bump and add it to requirements
* Fix gen_requirements for pre-commit, remove 'v' from version
* 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
* Use f-strings in integrations starting with "H"
* Use f-strings in integrations starting with "I"
* Use f-strings in integrations starting with "J"
* Use f-strings in integrations starting with "K"
* Use f-strings in integrations starting with "L"
* Fix lint error
* Use join instead of f-string in homekit_controller
* Use local variables with f-strings
* Fix lint error
* Escape the characters in f-string
* Sort imports with isort in homeworks light
* Fix pylint error
* Fix broken tests
* Fix broken tests v2
* 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>
* 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.