1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-03 03:42:20 +01:00

Fix import_full_config for adoption configs (#4197)

* Fix git raw url

* Fix setting full config query param

* Force dashboard import urls to have a branch or tag reference for full import
This commit is contained in:
Jesse Hills
2022-12-16 19:46:56 +13:00
committed by GitHub
parent 39af967433
commit b48b5d6cc7
2 changed files with 23 additions and 10 deletions

View File

@@ -129,9 +129,9 @@ class GitFile:
def raw_url(self) -> str:
if self.ref is None:
raise ValueError("URL has no ref")
if self.domain == "github":
if self.domain == "github.com":
return f"https://raw.githubusercontent.com/{self.owner}/{self.repo}/{self.ref}/{self.filename}"
if self.domain == "gitlab":
if self.domain == "gitlab.com":
return f"https://gitlab.com/{self.owner}/{self.repo}/-/raw/{self.ref}/{self.filename}"
raise NotImplementedError(f"Git domain {self.domain} not supported")