Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Correct input_datetime initial value parsing #10417
Fixes an issue with both initial value and state restore for input_datetime where if a time or date was used setting values neither way worked. datetime values were working fine.
Tests were adjusted accordingly
Related issue (if applicable): fixes #10245
Pull request in home-assistant.github.io with documentation (if applicable): N/A, bugfix only
Example entry for
referenced this pull request
Nov 10, 2017
This is true @tinloaf
Would you suggest something like this?
vol.Optional(CONF_INITIAL): vol.Any(cv.time, cv.date, cv.datetime)
Haven't used voluptuous before, but this would seem to make sense looking at other examples I think.
Problem is, to be fully valid there would have to be a validation function to compare which combination(s) of
I think to do this properly, one would need to check that either of the following three is true:
This should be achievable by building a validation for each of them along the lines of
and combining them with
Thanks again @tinloaf
My first time doing this and I managed to get the below to work but I needed to duplicate the
Sorry, my first time with voluptuous so figuring myself out here as well.
OK, this seems to work. Does it make sense?
If this is all OK then I will also similarly adjust