Add support pet feeder to xiaomi source #2078

This commit is contained in:
Alex X
2026-02-07 16:14:10 +03:00
parent e90f159c68
commit e5bb03349b
+7 -1
View File
@@ -262,7 +262,7 @@ func apiDeviceList(w http.ResponseWriter, r *http.Request) {
var items []*api.Source
for _, device := range v.List {
if !strings.Contains(device.Model, ".camera.") && !strings.Contains(device.Model, ".cateye.") {
if !device.HasCamera() {
continue
}
items = append(items, &api.Source{
@@ -289,6 +289,12 @@ type Device struct {
IP string `json:"localip"`
}
func (d *Device) HasCamera() bool {
return strings.Contains(d.Model, ".camera.") ||
strings.Contains(d.Model, ".cateye.") ||
strings.Contains(d.Model, ".feeder.")
}
var auth *xiaomi.Cloud
func apiAuth(w http.ResponseWriter, r *http.Request) {