Finished tibber controller logic

This commit is contained in:
Ziver Koc 2024-12-29 00:38:07 +01:00
parent 12d3c80ba8
commit 96635381f4
7 changed files with 135 additions and 8 deletions

View file

@ -1,7 +1,32 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2024 Ziver Koc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package se.hal.plugin.dummy;
import se.hal.HalServer;
import se.hal.intf.*;
import se.hal.util.ListenerUtil;
import zutil.log.LogUtil;
import java.util.ArrayList;
@ -39,9 +64,7 @@ public class DummyController implements HalSensorController, HalEventController,
for (DummyDevice device : registeredDevices) {
HalDeviceData data = device.generateData();
for (HalDeviceReportListener deviceListener : deviceListeners) {
deviceListener.reportReceived(device, data);
}
ListenerUtil.callReportReceived(deviceListeners, device, data);
}
} catch (Exception e) {
logger.log(Level.SEVERE, "Dummy device data generation has crashed.", e);