feat: update DiscoveryMessage struct and add API documentation

This commit is contained in:
2026-01-14 14:49:57 +01:00
parent 2f9bd6316b
commit 152d5b82cd
2 changed files with 1027 additions and 3 deletions
+1024
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -162,7 +162,7 @@ func (h *Handler) updateExistingDevice(msg DiscoveryMessage, previousStatusID in
return nil return nil
} }
// getDeviceSensors retrieves existing sensors for a device // getDeviceSensors retrieves existing sensors for a device<
func getDeviceSensors(tx *sql.Tx, deviceID string) (map[string]DiscoverySensorPayload, error) { func getDeviceSensors(tx *sql.Tx, deviceID string) (map[string]DiscoverySensorPayload, error) {
rows, err := tx.Query( rows, err := tx.Query(
"SELECT BIN_TO_UUID(id), name, type, data_type_id FROM sensors WHERE device_id = UUID_TO_BIN(?) ORDER BY id", "SELECT BIN_TO_UUID(id), name, type, data_type_id FROM sensors WHERE device_id = UUID_TO_BIN(?) ORDER BY id",