-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix: Input Datatime config schema #12552
Conversation
* Has_at_least_one_key_value only works if parameter is optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how has_at_least_one_key_value
should only work on optional arguments, but of course these could be made optional.
@@ -43,8 +43,8 @@ | |||
DOMAIN: vol.Schema({ | |||
cv.slug: vol.All({ | |||
vol.Optional(CONF_NAME): cv.string, | |||
vol.Required(CONF_HAS_DATE): cv.boolean, | |||
vol.Required(CONF_HAS_TIME): cv.boolean, | |||
vol.Optional(CONF_HAS_DATE): cv.boolean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please set the default to False
. Otherwise, None
is being passed around instead of False
, which of course works just as False
in if self._has_date
, but gives you strange values in the attributes. Also, yay for type safety.
@tinloaf It would work on required parameters as well, but than voluptuous catches it first if not given. |
I just saw that https://home-assistant.io/components/input_datetime/ already listed the parameters as being optional. Thanks for catching this! |
Description:
Has_at_least_one_key_value
only works if parameter are optionalExample entry for
configuration.yaml
(if applicable):Checklist: