Skip to content
Snippets Groups Projects
Commit fe63bf45 authored by KERDREUX Jerome's avatar KERDREUX Jerome
Browse files

Apply filter on link quality

parent e0da20bd
No related branches found
No related tags found
No related merge requests found
......@@ -135,7 +135,10 @@ func (dev *LinkQuality) update(payload map[string]interface{}) {
value, err := convertToInt(payload[dev.Expose.Name])
if err == nil {
value = value * 100 / 255
dev.GetAttribute("level").SetValue(value)
oldValue := dev.GetAttribute("level").Value.(int)
if value > oldValue+5 || value < oldValue-5 {
dev.GetAttribute("level").SetValue(value)
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment