Skip to content

Commit

Permalink
Merge pull request #258 from rohankapoorcom/correct-path-registration
Browse files Browse the repository at this point in the history
  • Loading branch information
vigonotion authored Nov 7, 2024
2 parents 34d2f86 + 4f703c3 commit e81f0ad
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions custom_components/simpleicons/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@


class IconView(HomeAssistantView):

requires_auth = False

def __init__(self, slug):
Expand All @@ -29,7 +28,6 @@ async def get(self, request):


class ListView(HomeAssistantView):

requires_auth = False

def __init__(self):
Expand All @@ -41,12 +39,15 @@ async def get(self, request):


async def async_setup(hass, config):
await hass.http.async_register_static_paths([
StaticPathConfig("/simpleicons/si.js",
"/config/custom_components/simpleicons/data/si.js", True
)
])

await hass.http.async_register_static_paths(
[
StaticPathConfig(
f"/{DOMAIN}/si.js",
hass.config.path(f"custom_components/{DOMAIN}/data/si.js"),
True,
)
]
)

hass.http.register_view(ListView())

Expand Down

0 comments on commit e81f0ad

Please sign in to comment.