EEbus: add ski suggestion service (#26878)
This commit is contained in:
parent
2f5f2f1e9f
commit
7229bbe0fd
2 changed files with 26 additions and 0 deletions
25
server/eebus/service.go
Normal file
25
server/eebus/service.go
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package eebus
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/evcc-io/evcc/server/service"
|
||||
)
|
||||
|
||||
func init() {
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("GET /services", getServices)
|
||||
|
||||
service.Register("eebus", mux)
|
||||
}
|
||||
|
||||
func getServices(w http.ResponseWriter, req *http.Request) {
|
||||
var res []string
|
||||
if Instance != nil {
|
||||
for _, s := range Instance.RemoteServices() {
|
||||
res = append(res, s.Ski)
|
||||
}
|
||||
}
|
||||
json.NewEncoder(w).Encode(res)
|
||||
}
|
||||
|
|
@ -269,6 +269,7 @@ params:
|
|||
help:
|
||||
en: Usually found on the web interface of the wallbox
|
||||
de: Üblicherweise im Web Interface der Wallbox zu finden
|
||||
service: eebus/services
|
||||
- name: uri
|
||||
private: true
|
||||
description:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue