Example #1
0
func (o *OpenHABPusher) AddMonitoredMAC(macAddress, itemName string) error {
	hwAddr, err := net.ParseMAC(macAddress)
	if err != nil {
		return err
	}
	key := store.ConvertHWAddr(probecollector.HardwareAddr(hwAddr))
	o.monitoredMACs[key] = itemName
	return nil
}
Example #2
0
func (o *OpenHABPusher) DeviceLost(pr probecollector.ProbeRequest) {
	key := store.ConvertHWAddr(pr.HWAddr)
	if itemName, exists := o.monitoredMACs[key]; exists {
		o.client.SendCommand(itemName, "OFF")
	}
}