Test function for mqtt topic validators and IsFile() linting fix (#1740)
* Add test function for mqtt topic validators. * Fix for linting error on vol.IsFile()
This commit is contained in:
parent
7d9b13a6a2
commit
5b17f629ad
3 changed files with 12 additions and 1 deletions
|
@ -34,6 +34,11 @@ def boolean(value):
|
|||
return bool(value)
|
||||
|
||||
|
||||
def isfile(value):
|
||||
"""Validate that the value is an existing file."""
|
||||
return vol.IsFile('not a file')(value)
|
||||
|
||||
|
||||
def ensure_list(value):
|
||||
"""Wrap value in list if it is not one."""
|
||||
return value if isinstance(value, list) else [value]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue