Service validation for media_player component
This commit is contained in:
1 parent
5c262753d4
commit
afd1e6a5cc
2 files changed
+51
-42
No files matched your search
@@ -47,6 +47,13 @@ def icon(value):
|
||||
raise vol.Invalid('Icons should start with prefix "mdi:"')
|
||||
|
||||
|
||||
def string(value):
|
||||
"""Coerce value to string, except for None."""
|
||||
if value is not None:
|
||||
return str(value)
|
||||
raise vol.Invalid('Value should not be None')
|
||||
|
||||
|
||||
def temperature_unit(value):
|
||||
"""Validate and transform temperature unit."""
|
||||
if isinstance(value, str):
|
||||
|
||||
Reference in new issue
Block a user