Skip to content

Commit

Permalink
Merge pull request #40 from TheCacophonyProject/sync-settings
Browse files Browse the repository at this point in the history
allow empty settings to be sent
  • Loading branch information
Zainrax authored Aug 26, 2024
2 parents a30b058 + 6a578ca commit 90d3a2b
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -777,10 +777,6 @@ func (api *CacophonyAPI) GetDeviceSettings() (map[string]interface{}, error) {

// UpdateDeviceSettings updates the device settings on the API and returns the updated settings
func (api *CacophonyAPI) UpdateDeviceSettings(settings map[string]interface{}) (map[string]interface{}, error) {
if len(settings) == 0 {
fmt.Println("settings is empty")
return nil, nil
}
url := joinURL(api.serverURL, apiBasePath, "devices/"+strconv.Itoa(api.device.id)+"/settings")
payload, err := json.Marshal(map[string]interface{}{
"settings": settings,
Expand Down

0 comments on commit 90d3a2b

Please sign in to comment.