mirror of
https://github.com/esphome/esphome.git
synced 2025-02-13 08:28:19 +00:00
Merge branch 'dev' into dev
This commit is contained in:
commit
6dc1117bd7
@ -1949,13 +1949,13 @@ def url(value):
|
|||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
raise Invalid("Not a valid URL") from e
|
raise Invalid("Not a valid URL") from e
|
||||||
|
|
||||||
if not parsed.scheme or not parsed.netloc:
|
if parsed.scheme and parsed.netloc or parsed.scheme == "file":
|
||||||
raise Invalid("Expected a URL scheme and host")
|
|
||||||
return parsed.geturl()
|
return parsed.geturl()
|
||||||
|
raise Invalid("Expected a file scheme or a URL scheme with host")
|
||||||
|
|
||||||
|
|
||||||
def git_ref(value):
|
def git_ref(value):
|
||||||
if re.match(r"[a-zA-Z0-9\-_.\./]+", value) is None:
|
if re.match(r"[a-zA-Z0-9_./-]+", value) is None:
|
||||||
raise Invalid("Not a valid git ref")
|
raise Invalid("Not a valid git ref")
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user