Skip to content

Commit

Permalink
simplify updatet update loop
Browse files Browse the repository at this point in the history
  • Loading branch information
splattner committed Oct 30, 2023
1 parent be52968 commit a2bc586
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/denonavr/attributes.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package denonavr

import "reflect"

// Set an attribute and call entity Change function if changed
func (d *DenonAVR) SetAttribute(name string, value interface{}) {

changed := d.attributes[name] != nil && d.attributes[name] != value
changed := d.attributes[name] != nil && !reflect.DeepEqual(d.attributes[name], value)

d.attributes[name] = value

Expand Down

0 comments on commit a2bc586

Please sign in to comment.