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

Comments

parent 6406e343
No related branches found
No related tags found
No related merge requests found
......@@ -207,10 +207,12 @@ func NewPowerMeter(addr uuid.UUID, zDev *Z2MDevice) XAALDeviceInterface {
}
func (dev *PowerMeter) update(payload map[string]interface{}) {
// power
value, exists := payload["power"].(float64)
if exists {
dev.GetAttribute("power").SetValue(value)
}
// energy
value, exists = payload["energy"].(float64)
if exists {
dev.GetAttribute("energy").SetValue(value)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment