Code refactoring for streams HandleFunc

This commit is contained in:
Alex X
2024-06-14 12:48:29 +03:00
parent 1ac9d54dab
commit ecfe802065
15 changed files with 53 additions and 93 deletions
+2 -7
View File
@@ -45,14 +45,9 @@ func Init() {
return "", nil
})
streams.HandleFunc("hass", func(url string) (core.Producer, error) {
streams.HandleFunc("hass", func(source string) (core.Producer, error) {
// support hass://supervisor?entity_id=camera.driveway_doorbell
client, err := hass.NewClient(url)
if err != nil {
return nil, err
}
return client, nil
return hass.NewClient(source)
})
// load static entries from Hass config