mirror of
https://github.com/esphome/esphome.git
synced 2025-09-06 05:12:21 +01:00
Relax the icon validator to allow non-mdi icons (#2764)
This commit is contained in:
@@ -296,9 +296,11 @@ def icon(value):
|
||||
value = string_strict(value)
|
||||
if not value:
|
||||
return value
|
||||
if value.startswith("mdi:"):
|
||||
if re.match("^[\\w\\-]+:[\\w\\-]+$", value):
|
||||
return value
|
||||
raise Invalid('Icons should start with prefix "mdi:"')
|
||||
raise Invalid(
|
||||
'Icons must match the format "[icon pack]:[icon]", e.g. "mdi:home-assistant"'
|
||||
)
|
||||
|
||||
|
||||
def boolean(value):
|
||||
|
Reference in New Issue
Block a user