Skip to content
Snippets Groups Projects
Commit 4ec4eec8 authored by jkerdreu's avatar jkerdreu
Browse files

- Added Queue for AttributesChange to be able to group attributes per device

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Go/trunk/xaal-lib/apps@3125 b32b6428-25c9-4566-ad07-03861ab6144f
parent 386961a7
No related branches found
No related tags found
No related merge requests found
......@@ -34,11 +34,12 @@ func newLamp(addr uuid.UUID, group uuid.UUID) *Lamp {
// turnOn set the brightness to 50 to test attributes grouped msg
func (l *Lamp) turnOn(xAALLib.MessageBody) *xAALLib.MessageBody {
light := l.dev.GetAttribute("light")
brightness := l.dev.GetAttribute("brightness")
if light.Value.(bool) == true {
return nil
}
light.SetValue(true)
brightness := l.dev.GetAttribute("brightness")
if brightness.Value.(int) == 0 {
brightness.SetValue(50)
}
......@@ -48,11 +49,13 @@ func (l *Lamp) turnOn(xAALLib.MessageBody) *xAALLib.MessageBody {
// turnOff set the brightness to 0 to test attributes grouped msg
func (l *Lamp) turnOff(xAALLib.MessageBody) *xAALLib.MessageBody {
light := l.dev.GetAttribute("light")
brightness := l.dev.GetAttribute("brightness")
if light.Value.(bool) == false {
return nil
}
light.SetValue(false)
l.dev.GetAttribute("brightness").SetValue(0)
brightness.SetValue(0)
return nil
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment