Refactoring of of inheritance structure, ControllerManagers will now also be able to be provided through plugins
This commit is contained in:
parent
28bc108921
commit
c0188cd5cc
73 changed files with 1083 additions and 991 deletions
|
|
@ -1,6 +1,8 @@
|
|||
package se.hal.plugin.dummy;
|
||||
|
||||
import se.hal.EventControllerManager;
|
||||
import se.hal.HalServer;
|
||||
import se.hal.SensorControllerManager;
|
||||
import se.hal.intf.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -10,8 +12,8 @@ import java.util.concurrent.*;
|
|||
|
||||
public class DummyController implements HalSensorController, HalEventController, Runnable, HalDaemon {
|
||||
private List<DummyDevice> registeredDevices = new ArrayList();
|
||||
private HalSensorReportListener sensorListener;
|
||||
private HalEventReportListener eventListener;
|
||||
private HalDeviceReportListener sensorListener;
|
||||
private HalDeviceReportListener eventListener;
|
||||
|
||||
|
||||
public DummyController() {}
|
||||
|
|
@ -45,27 +47,14 @@ public class DummyController implements HalSensorController, HalEventController,
|
|||
}
|
||||
|
||||
@Override
|
||||
public synchronized void register(HalSensorConfig sensorConfig) {
|
||||
if (sensorConfig instanceof DummyDevice) {
|
||||
registeredDevices.add((DummyDevice) sensorConfig);
|
||||
}
|
||||
public synchronized void register(HalDeviceConfig deviceConfig) {
|
||||
if (deviceConfig instanceof DummyDevice)
|
||||
registeredDevices.add((DummyDevice) deviceConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void register(HalEventConfig eventConfig) {
|
||||
if (eventConfig instanceof DummyDevice) {
|
||||
registeredDevices.add((DummyDevice) eventConfig);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void deregister(HalSensorConfig sensorConfig) {
|
||||
registeredDevices.remove(sensorConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void deregister(HalEventConfig eventConfig) {
|
||||
registeredDevices.remove(eventConfig);
|
||||
public synchronized void deregister(HalDeviceConfig deviceConfig) {
|
||||
registeredDevices.remove(deviceConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -79,10 +68,12 @@ public class DummyController implements HalSensorController, HalEventController,
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setListener(HalSensorReportListener listener) { sensorListener = listener; }
|
||||
|
||||
@Override
|
||||
public void setListener(HalEventReportListener listener) { eventListener = listener; }
|
||||
public void setListener(HalDeviceReportListener listener) {
|
||||
if (listener instanceof SensorControllerManager)
|
||||
sensorListener = listener;
|
||||
else if (listener instanceof EventControllerManager)
|
||||
eventListener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void close() {
|
||||
|
|
|
|||
|
|
@ -31,12 +31,12 @@ public class DummyHumiditySensor implements DummyDevice, HalSensorConfig {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends HalSensorController> getSensorControllerClass() {
|
||||
public Class<? extends HalSensorController> getDeviceControllerClass() {
|
||||
return DummyController.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends HalSensorData> getSensorDataClass() {
|
||||
public Class<? extends HalSensorData> getDeviceDataClass() {
|
||||
return HumiditySensorData.class;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@ public class DummySwitchEvent implements DummyDevice, HalEventConfig {
|
|||
|
||||
|
||||
@Override
|
||||
public Class<? extends HalEventController> getEventControllerClass() {
|
||||
public Class<? extends HalEventController> getDeviceControllerClass() {
|
||||
return DummyController.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends HalEventData> getEventDataClass() {
|
||||
public Class<? extends HalEventData> getDeviceDataClass() {
|
||||
return OnOffEventData.class;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,12 +30,12 @@ public class DummyTemperatureSensor implements DummyDevice, HalSensorConfig {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends HalSensorController> getSensorControllerClass() {
|
||||
public Class<? extends HalSensorController> getDeviceControllerClass() {
|
||||
return DummyController.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends HalSensorData> getSensorDataClass() {
|
||||
public Class<? extends HalSensorData> getDeviceDataClass() {
|
||||
return TemperatureSensorData.class;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class HalMqttController implements HalAutoScannableController, MqttSubscr
|
|||
private MqttBroker mqttBroker;
|
||||
|
||||
private HashMap<String, HalMqttDeviceConfig> topics = new HashMap<>();
|
||||
private HalEventReportListener eventListener;
|
||||
private HalDeviceReportListener eventListener;
|
||||
|
||||
// --------------------------
|
||||
// Lifecycle methods
|
||||
|
|
@ -116,18 +116,18 @@ public class HalMqttController implements HalAutoScannableController, MqttSubscr
|
|||
// --------------------------
|
||||
|
||||
@Override
|
||||
public void register(HalEventConfig eventConfig) {
|
||||
if(eventConfig instanceof HalMqttDeviceConfig) {
|
||||
HalMqttDeviceConfig mqttEvent = (HalMqttDeviceConfig) eventConfig;
|
||||
public void register(HalDeviceConfig deviceConfig) {
|
||||
if(deviceConfig instanceof HalMqttDeviceConfig) {
|
||||
HalMqttDeviceConfig mqttEvent = (HalMqttDeviceConfig) deviceConfig;
|
||||
topics.put(mqttEvent.getTopic(), mqttEvent);
|
||||
} else throw new IllegalArgumentException(
|
||||
"Device config is not an instance of " + HalMqttDeviceConfig.class + ": " + eventConfig.getClass());
|
||||
"Device config is not an instance of " + HalMqttDeviceConfig.class + ": " + deviceConfig.getClass());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deregister(HalEventConfig eventConfig) {
|
||||
if(eventConfig instanceof HalMqttDeviceConfig) {
|
||||
HalMqttDeviceConfig mqttEvent = (HalMqttDeviceConfig) eventConfig;
|
||||
public void deregister(HalDeviceConfig deviceConfig) {
|
||||
if(deviceConfig instanceof HalMqttDeviceConfig) {
|
||||
HalMqttDeviceConfig mqttEvent = (HalMqttDeviceConfig) deviceConfig;
|
||||
topics.remove(mqttEvent.getTopic());
|
||||
}
|
||||
}
|
||||
|
|
@ -147,7 +147,7 @@ public class HalMqttController implements HalAutoScannableController, MqttSubscr
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setListener(HalEventReportListener listener) {
|
||||
public void setListener(HalDeviceReportListener listener) {
|
||||
eventListener = listener;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,12 +71,12 @@ public class HalMqttDeviceConfig implements HalEventConfig {
|
|||
// --------------------------
|
||||
|
||||
@Override
|
||||
public Class<? extends HalEventController> getEventControllerClass() {
|
||||
public Class<? extends HalEventController> getDeviceControllerClass() {
|
||||
return HalMqttController.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends HalEventData> getEventDataClass() {
|
||||
public Class<? extends HalEventData> getDeviceDataClass() {
|
||||
return HalMqttDeviceData.class;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public class NetScanController implements HalEventController, HalAutoScannableCo
|
|||
private static final String PARAM_IPSCAN = "netscan.ipscan";
|
||||
|
||||
private ScheduledExecutorService executor;
|
||||
private HalEventReportListener listener;
|
||||
private HalDeviceReportListener listener;
|
||||
/** A register and a cache of previous state **/
|
||||
private HashMap<NetworkDevice, AvailabilityEventData> devices = new HashMap<>();
|
||||
|
||||
|
|
@ -97,14 +97,16 @@ public class NetScanController implements HalEventController, HalAutoScannableCo
|
|||
|
||||
|
||||
@Override
|
||||
public void register(HalEventConfig event) {
|
||||
if (event instanceof NetworkDevice)
|
||||
devices.put((NetworkDevice) event, null);
|
||||
public void register(HalDeviceConfig deviceConfig) {
|
||||
if (deviceConfig instanceof NetworkDevice)
|
||||
devices.put((NetworkDevice) deviceConfig, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deregister(HalEventConfig event) {
|
||||
devices.remove(event);
|
||||
public void deregister(HalDeviceConfig deviceConfig) {
|
||||
devices.remove(deviceConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return devices.size();
|
||||
|
|
@ -116,7 +118,7 @@ public class NetScanController implements HalEventController, HalAutoScannableCo
|
|||
|
||||
|
||||
@Override
|
||||
public void setListener(HalEventReportListener listener) {
|
||||
public void setListener(HalDeviceReportListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,11 +35,11 @@ public class NetworkDevice implements HalEventConfig {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends HalEventController> getEventControllerClass() {
|
||||
public Class<? extends HalEventController> getDeviceControllerClass() {
|
||||
return NetScanController.class;
|
||||
}
|
||||
@Override
|
||||
public Class<? extends HalEventData> getEventDataClass() {
|
||||
public Class<? extends HalEventData> getDeviceDataClass() {
|
||||
return OnOffEventData.class;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,10 +49,7 @@
|
|||
package se.hal.plugin.nutups;
|
||||
|
||||
import se.hal.HalContext;
|
||||
import se.hal.intf.HalAutoScannableController;
|
||||
import se.hal.intf.HalSensorController;
|
||||
import se.hal.intf.HalSensorConfig;
|
||||
import se.hal.intf.HalSensorReportListener;
|
||||
import se.hal.intf.*;
|
||||
import zutil.log.LogUtil;
|
||||
import zutil.osal.linux.app.NutUPSClient;
|
||||
|
||||
|
|
@ -63,6 +60,7 @@ import java.util.concurrent.TimeUnit;
|
|||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
||||
public class NutUpsController implements HalSensorController, HalAutoScannableController, Runnable{
|
||||
public static Logger logger = LogUtil.getLogger();
|
||||
|
||||
|
|
@ -73,7 +71,7 @@ public class NutUpsController implements HalSensorController, HalAutoScannableCo
|
|||
private HashMap<String, NutUpsDevice> registeredDevices = new HashMap<>();
|
||||
private NutUPSClient client;
|
||||
private ScheduledExecutorService executor;
|
||||
private HalSensorReportListener listener;
|
||||
private HalDeviceReportListener listener;
|
||||
|
||||
|
||||
|
||||
|
|
@ -97,7 +95,7 @@ public class NutUpsController implements HalSensorController, HalAutoScannableCo
|
|||
|
||||
|
||||
@Override
|
||||
public void setListener(HalSensorReportListener listener) {
|
||||
public void setListener(HalDeviceReportListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
|
|
@ -126,16 +124,19 @@ public class NutUpsController implements HalSensorController, HalAutoScannableCo
|
|||
|
||||
|
||||
@Override
|
||||
public void register(HalSensorConfig sensor) {
|
||||
registeredDevices.put(((NutUpsDevice) sensor).getUpsId(), (NutUpsDevice) sensor);
|
||||
public void register(HalDeviceConfig deviceConfig) {
|
||||
if (deviceConfig instanceof NutUpsDevice)
|
||||
registeredDevices.put(((NutUpsDevice) deviceConfig).getUpsId(), (NutUpsDevice) deviceConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deregister(HalSensorConfig sensor) {
|
||||
registeredDevices.remove(((NutUpsDevice) sensor).getUpsId());
|
||||
public void deregister(HalDeviceConfig deviceConfig) {
|
||||
registeredDevices.remove(((NutUpsDevice) deviceConfig).getUpsId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return 0;
|
||||
return registeredDevices.size();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,11 +102,11 @@ public class NutUpsDevice implements HalSensorConfig{
|
|||
return AggregationMethod.SUM;
|
||||
}
|
||||
@Override
|
||||
public Class<? extends HalSensorController> getSensorControllerClass() {
|
||||
public Class<? extends HalSensorController> getDeviceControllerClass() {
|
||||
return NutUpsController.class;
|
||||
}
|
||||
@Override
|
||||
public Class<? extends HalSensorData> getSensorDataClass() {
|
||||
public Class<? extends HalSensorData> getDeviceDataClass() {
|
||||
return PowerConsumptionSensorData.class;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,71 @@
|
|||
package se.hal.plugin.nvr;
|
||||
|
||||
import se.hal.intf.HalAbstractControllerManager;
|
||||
import se.hal.plugin.nvr.intf.HalCameraConfig;
|
||||
import se.hal.plugin.nvr.intf.HalCameraController;
|
||||
import se.hal.plugin.nvr.struct.Camera;
|
||||
import se.hal.struct.AbstractDevice;
|
||||
import zutil.log.LogUtil;
|
||||
import zutil.plugin.PluginManager;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
||||
public class CameraControllerManager extends HalAbstractControllerManager<HalCameraController, Camera, HalCameraConfig> {
|
||||
private static final Logger logger = LogUtil.getLogger();
|
||||
private static CameraControllerManager instance;
|
||||
|
||||
|
||||
@Override
|
||||
public void register(Camera device) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deregister(Camera device) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Class<? extends HalCameraConfig>> getAvailableDeviceConfigs() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Camera> getRegisteredDevices() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Camera> getDetectedDevices() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAvailableDevice(Class deviceConfigClass) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearDetectedDevices() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<HalCameraController> getControllers() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public void initialize(PluginManager pluginManager){
|
||||
super.initialize(pluginManager);
|
||||
|
||||
instance = this;
|
||||
}
|
||||
|
||||
public static CameraControllerManager getInstance(){
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2021 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.nvr;
|
||||
|
||||
import se.hal.intf.HalAbstractController;
|
||||
import se.hal.plugin.nvr.device.HalCameraConfig;
|
||||
import se.hal.plugin.nvr.device.HalCameraReportListener;
|
||||
|
||||
public interface HalCameraController extends HalAbstractController {
|
||||
|
||||
/**
|
||||
* Will register a camera to be handled by this controller.
|
||||
*/
|
||||
void register(HalCameraConfig cameraConfig);
|
||||
|
||||
/**
|
||||
* Deregisters a camera from this controller, the controller
|
||||
* will no longer handle camera device.
|
||||
*/
|
||||
void deregister(HalCameraConfig cameraConfig);
|
||||
|
||||
/**
|
||||
* Set a listener that will receive all reports from the the registered camera.
|
||||
*/
|
||||
void setListener(HalCameraReportListener listener);
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
package se.hal.plugin.nvr.device;
|
||||
|
||||
import se.hal.plugin.nvr.HalCameraController;
|
||||
|
||||
/**
|
||||
* Listener to be called by the {@link HalCameraController} to report that a camera event has been observed.
|
||||
*/
|
||||
public interface HalCameraReportListener {
|
||||
|
||||
}
|
||||
|
|
@ -22,15 +22,10 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package se.hal.plugin.nvr.device;
|
||||
package se.hal.plugin.nvr.intf;
|
||||
|
||||
import se.hal.plugin.nvr.HalCameraController;
|
||||
import se.hal.intf.HalDeviceConfig;
|
||||
|
||||
public interface HalCameraConfig {
|
||||
|
||||
/**
|
||||
* @return the Controller class where CameraData should be registered on
|
||||
*/
|
||||
Class<? extends HalCameraController> getCameraControllerClass();
|
||||
public interface HalCameraConfig extends HalDeviceConfig {
|
||||
|
||||
}
|
||||
|
|
@ -22,8 +22,11 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package se.hal.plugin.nvr;
|
||||
package se.hal.plugin.nvr.intf;
|
||||
|
||||
public class StreamRecorder {
|
||||
import se.hal.intf.HalAbstractController;
|
||||
|
||||
|
||||
public interface HalCameraController extends HalAbstractController {
|
||||
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package se.hal.plugin.nvr.device;
|
||||
package se.hal.plugin.nvr.intf;
|
||||
|
||||
import se.hal.intf.HalDeviceData;
|
||||
|
||||
|
|
@ -24,11 +24,11 @@
|
|||
|
||||
package se.hal.plugin.nvr.page;
|
||||
|
||||
import se.hal.ControllerManager;
|
||||
import se.hal.HalContext;
|
||||
import se.hal.intf.HalWebPage;
|
||||
import se.hal.page.HalAlertManager;
|
||||
import se.hal.plugin.nvr.device.Camera;
|
||||
import se.hal.plugin.nvr.CameraControllerManager;
|
||||
import se.hal.plugin.nvr.struct.Camera;
|
||||
import se.hal.struct.ClassConfigurationData;
|
||||
import se.hal.struct.User;
|
||||
import zutil.ObjectUtil;
|
||||
|
|
@ -36,7 +36,6 @@ import zutil.db.DBConnection;
|
|||
import zutil.io.file.FileUtil;
|
||||
import zutil.log.LogUtil;
|
||||
import zutil.parser.Templator;
|
||||
import zutil.ui.UserMessageManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
|
|
@ -56,7 +55,7 @@ public class CameraConfigWebPage extends HalWebPage {
|
|||
super.getRootNav().createSubNav("Settings").createSubNav(this.getId(), "Camera Settings").setWeight(200);
|
||||
|
||||
cameraConfigurations = new ArrayList<>();
|
||||
for(Class c : ControllerManager.getInstance().getAvailableEvents())
|
||||
for(Class c : CameraControllerManager.getInstance().getAvailableDeviceConfigs())
|
||||
cameraConfigurations.add(new ClassConfigurationData(c));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ package se.hal.plugin.nvr.page;
|
|||
|
||||
import se.hal.HalContext;
|
||||
import se.hal.intf.HalWebPage;
|
||||
import se.hal.plugin.nvr.device.Camera;
|
||||
import se.hal.plugin.nvr.struct.Camera;
|
||||
import se.hal.struct.Event;
|
||||
import se.hal.util.DeviceNameComparator;
|
||||
import zutil.ObjectUtil;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
"name": "Hal-NVR",
|
||||
"description": "A Network Video Recorder plugin for recording network streams.",
|
||||
"interfaces": [
|
||||
{"se.hal.intf.HalAbstractControllerManager": "se.hal.plugin.nvr.CameraControllerManager"},
|
||||
|
||||
{"se.hal.intf.HalWebPage": "se.hal.plugin.nvr.page.CameraConfigWebPage"},
|
||||
{"se.hal.intf.HalWebPage": "se.hal.plugin.nvr.page.CameraOverviewWebPage"},
|
||||
{"se.hal.intf.HalWebPage": "se.hal.plugin.nvr.page.MonitorWebPage"}
|
||||
|
|
|
|||
|
|
@ -24,8 +24,9 @@
|
|||
|
||||
package se.hal.plugin.nvr.rtsp;
|
||||
|
||||
import se.hal.plugin.nvr.HalCameraController;
|
||||
import se.hal.plugin.nvr.device.HalCameraConfig;
|
||||
import se.hal.intf.HalDeviceData;
|
||||
import se.hal.plugin.nvr.intf.HalCameraController;
|
||||
import se.hal.plugin.nvr.intf.HalCameraConfig;
|
||||
|
||||
public class RTSPCameraConfig implements HalCameraConfig {
|
||||
|
||||
|
|
@ -38,8 +39,18 @@ public class RTSPCameraConfig implements HalCameraConfig {
|
|||
}
|
||||
|
||||
|
||||
public String getRtspUrl() {
|
||||
return rtspUrl;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Class<? extends HalCameraController> getCameraControllerClass() {
|
||||
public Class<? extends HalCameraController> getDeviceControllerClass() {
|
||||
return RTSPController.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends HalDeviceData> getDeviceDataClass() {
|
||||
return null; // TODO:
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
package se.hal.plugin.nvr.rtsp;
|
||||
|
||||
import zutil.log.LogUtil;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* A instance of this class will manage a RTSP stream from a specified source.
|
||||
*/
|
||||
public class RTSPCameraRecorder implements Runnable {
|
||||
private static final Logger logger = LogUtil.getLogger();
|
||||
|
||||
private RTSPCameraConfig camera;
|
||||
|
||||
|
||||
public RTSPCameraRecorder(RTSPCameraConfig camera) {
|
||||
this.camera = camera;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
logger.info("Starting up RTSP Stream recording thread for: " + camera.getRtspUrl());
|
||||
|
||||
try {
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "RTSP Stream recording thread has crashed for: " + camera.getRtspUrl(), e);
|
||||
} finally {
|
||||
logger.info("Shutting down RTSP Stream recording thread for: " + camera.getRtspUrl());
|
||||
}
|
||||
}
|
||||
|
||||
public void close() {
|
||||
camera = null;
|
||||
}
|
||||
}
|
||||
|
|
@ -24,9 +24,9 @@
|
|||
|
||||
package se.hal.plugin.nvr.rtsp;
|
||||
|
||||
import se.hal.plugin.nvr.HalCameraController;
|
||||
import se.hal.plugin.nvr.device.HalCameraConfig;
|
||||
import se.hal.plugin.nvr.device.HalCameraReportListener;
|
||||
import se.hal.intf.HalDeviceConfig;
|
||||
import se.hal.intf.HalDeviceReportListener;
|
||||
import se.hal.plugin.nvr.intf.HalCameraController;
|
||||
import zutil.log.LogUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -40,7 +40,7 @@ public class RTSPController implements HalCameraController {
|
|||
private static final String CONFIG_RECORDING_PATH = "nvr.recording_path";
|
||||
|
||||
private List<RTSPCameraConfig> cameras = new ArrayList<>();
|
||||
private HalCameraReportListener listener;
|
||||
private HalDeviceReportListener listener;
|
||||
|
||||
|
||||
public RTSPController() {}
|
||||
|
|
@ -51,7 +51,7 @@ public class RTSPController implements HalCameraController {
|
|||
// ----------------------------------------------------
|
||||
|
||||
@Override
|
||||
public void initialize() throws Exception {
|
||||
public void initialize() {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -65,14 +65,14 @@ public class RTSPController implements HalCameraController {
|
|||
// ----------------------------------------------------
|
||||
|
||||
@Override
|
||||
public void register(HalCameraConfig cameraConfig) {
|
||||
if (cameraConfig instanceof RTSPCameraConfig)
|
||||
cameras.add((RTSPCameraConfig) cameraConfig);
|
||||
public void register(HalDeviceConfig deviceConfig) {
|
||||
if (deviceConfig instanceof RTSPCameraConfig)
|
||||
cameras.add((RTSPCameraConfig) deviceConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deregister(HalCameraConfig cameraConfig) {
|
||||
cameras.remove(cameraConfig);
|
||||
public void deregister(HalDeviceConfig deviceConfig) {
|
||||
cameras.remove(deviceConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -81,7 +81,7 @@ public class RTSPController implements HalCameraController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setListener(HalCameraReportListener listener) {
|
||||
public void setListener(HalDeviceReportListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,9 +22,11 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package se.hal.plugin.nvr.device;
|
||||
package se.hal.plugin.nvr.struct;
|
||||
|
||||
import se.hal.intf.HalAbstractController;
|
||||
import se.hal.plugin.nvr.intf.HalCameraConfig;
|
||||
import se.hal.plugin.nvr.intf.HalCameraData;
|
||||
import se.hal.struct.AbstractDevice;
|
||||
import zutil.db.DBConnection;
|
||||
import zutil.db.bean.DBBean;
|
||||
|
|
@ -46,7 +48,7 @@ public class Camera extends AbstractDevice<Camera, HalCameraConfig, HalCameraDat
|
|||
|
||||
@Override
|
||||
public Class<? extends HalAbstractController> getController() {
|
||||
return getDeviceConfig().getCameraControllerClass();
|
||||
return getDeviceConfig().getDeviceControllerClass();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -13,7 +13,7 @@ public class RPiController implements HalSensorController {
|
|||
private static final Logger logger = LogUtil.getLogger();
|
||||
|
||||
private HashMap<String, RPiSensor> pinToSensorMap = new HashMap<>();
|
||||
private HalSensorReportListener sensorListener;
|
||||
private HalDeviceReportListener sensorListener;
|
||||
|
||||
public RPiController(){
|
||||
|
||||
|
|
@ -25,9 +25,9 @@ public class RPiController implements HalSensorController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void register(HalSensorConfig sensor) {
|
||||
if(sensor instanceof RPiPowerConsumptionSensor){
|
||||
RPiPowerConsumptionSensor powerConsumptionSensor = (RPiPowerConsumptionSensor) sensor;
|
||||
public void register(HalDeviceConfig deviceConfig) {
|
||||
if(deviceConfig instanceof RPiPowerConsumptionSensor){
|
||||
RPiPowerConsumptionSensor powerConsumptionSensor = (RPiPowerConsumptionSensor) deviceConfig;
|
||||
int gpioPin = powerConsumptionSensor.getGpioPin();
|
||||
if(!pinToSensorMap.containsKey("GPIO_"+gpioPin)){
|
||||
RPiInteruptPulseFlankCounter impulseCounter = new RPiInteruptPulseFlankCounter(gpioPin, this);
|
||||
|
|
@ -35,8 +35,8 @@ public class RPiController implements HalSensorController {
|
|||
}else{
|
||||
logger.warning("Cannot create a RPiPowerConsumptionSensor on GPIO pin " + gpioPin + " since is already is in use by another sensor.");
|
||||
}
|
||||
} else if(sensor instanceof RPiTemperatureSensor){
|
||||
RPiTemperatureSensor temperatureSensor = (RPiTemperatureSensor) sensor;
|
||||
} else if(deviceConfig instanceof RPiTemperatureSensor){
|
||||
RPiTemperatureSensor temperatureSensor = (RPiTemperatureSensor) deviceConfig;
|
||||
String w1Address = temperatureSensor.get1WAddress();
|
||||
if(!pinToSensorMap.containsKey("W1_"+w1Address)){
|
||||
RPiDS18B20 ds12b20 = new RPiDS18B20(w1Address, this);
|
||||
|
|
@ -50,15 +50,15 @@ public class RPiController implements HalSensorController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void deregister(HalSensorConfig sensor) {
|
||||
if(sensor instanceof RPiPowerConsumptionSensor){
|
||||
RPiPowerConsumptionSensor powerConsumprtionSensor = (RPiPowerConsumptionSensor) sensor;
|
||||
RPiSensor sensorToDeregister = pinToSensorMap.remove("GPIO_"+powerConsumprtionSensor.getGpioPin());
|
||||
public void deregister(HalDeviceConfig deviceConfig) {
|
||||
if(deviceConfig instanceof RPiPowerConsumptionSensor){
|
||||
RPiPowerConsumptionSensor powerConsumptionSensor = (RPiPowerConsumptionSensor) deviceConfig;
|
||||
RPiSensor sensorToDeregister = pinToSensorMap.remove("GPIO_"+powerConsumptionSensor.getGpioPin());
|
||||
if(sensorToDeregister != null){
|
||||
sensorToDeregister.close();
|
||||
}
|
||||
} else if(sensor instanceof RPiTemperatureSensor){
|
||||
RPiTemperatureSensor temperatureSensor = (RPiTemperatureSensor) sensor;
|
||||
} else if(deviceConfig instanceof RPiTemperatureSensor){
|
||||
RPiTemperatureSensor temperatureSensor = (RPiTemperatureSensor) deviceConfig;
|
||||
RPiSensor sensorToDeregister = pinToSensorMap.remove("W1_"+temperatureSensor.get1WAddress());
|
||||
if(sensorToDeregister != null){
|
||||
sensorToDeregister.close();
|
||||
|
|
@ -75,7 +75,7 @@ public class RPiController implements HalSensorController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setListener(HalSensorReportListener listener) {
|
||||
public void setListener(HalDeviceReportListener listener) {
|
||||
sensorListener = listener;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,12 +30,12 @@ public class RPiPowerConsumptionSensor implements HalSensorConfig {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends HalSensorController> getSensorControllerClass() {
|
||||
public Class<? extends HalSensorController> getDeviceControllerClass() {
|
||||
return RPiController.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends HalSensorData> getSensorDataClass() {
|
||||
public Class<? extends HalSensorData> getDeviceDataClass() {
|
||||
return PowerConsumptionSensorData.class;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,12 +30,12 @@ public class RPiTemperatureSensor implements HalSensorConfig {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends HalSensorController> getSensorControllerClass() {
|
||||
public Class<? extends HalSensorController> getDeviceControllerClass() {
|
||||
return RPiController.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends HalSensorData> getSensorDataClass() {
|
||||
public Class<? extends HalSensorData> getDeviceDataClass() {
|
||||
return TemperatureSensorData.class;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,8 +61,7 @@ public class TellstickSerialComm implements Runnable,
|
|||
|
||||
protected TellstickParser parser;
|
||||
|
||||
private HalSensorReportListener sensorListener;
|
||||
private HalEventReportListener eventListener;
|
||||
private HalDeviceReportListener deviceListener;
|
||||
private List<TellstickDevice> registeredDevices;
|
||||
|
||||
|
||||
|
|
@ -186,10 +185,8 @@ public class TellstickSerialComm implements Runnable,
|
|||
set.add(data);
|
||||
}
|
||||
private void reportEvent(TellstickDevice tellstickDevice, HalDeviceData deviceData){
|
||||
if (sensorListener != null && tellstickDevice instanceof HalSensorConfig)
|
||||
sensorListener.reportReceived((HalSensorConfig) tellstickDevice, (HalSensorData) deviceData);
|
||||
else if (eventListener != null && tellstickDevice instanceof HalEventConfig)
|
||||
eventListener.reportReceived((HalEventConfig) tellstickDevice, (HalEventData) deviceData);
|
||||
if (deviceListener != null)
|
||||
deviceListener.reportReceived((HalDeviceConfig) tellstickDevice, deviceData);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -225,18 +222,11 @@ public class TellstickSerialComm implements Runnable,
|
|||
// --------------------------
|
||||
|
||||
@Override
|
||||
public void register(HalEventConfig event) {
|
||||
if(event instanceof TellstickDevice)
|
||||
registeredDevices.add((TellstickDevice) event);
|
||||
public void register(HalDeviceConfig deviceConfig) {
|
||||
if(deviceConfig instanceof TellstickDevice)
|
||||
registeredDevices.add((TellstickDevice) deviceConfig);
|
||||
else throw new IllegalArgumentException(
|
||||
"Device config is not an instance of "+TellstickDevice.class+": "+event.getClass());
|
||||
}
|
||||
@Override
|
||||
public void register(HalSensorConfig sensor) {
|
||||
if(sensor instanceof TellstickDevice)
|
||||
registeredDevices.add((TellstickDevice) sensor);
|
||||
else throw new IllegalArgumentException(
|
||||
"Device config is not an instance of "+TellstickDevice.class+": "+sensor.getClass());
|
||||
"Device config is not an instance of " + TellstickDevice.class + ": " + deviceConfig.getClass());
|
||||
}
|
||||
|
||||
public <T> List<T> getRegisteredDevices(Class<T> clazz){
|
||||
|
|
@ -249,12 +239,8 @@ public class TellstickSerialComm implements Runnable,
|
|||
}
|
||||
|
||||
@Override
|
||||
public void deregister(HalEventConfig event) {
|
||||
registeredDevices.remove(event);
|
||||
}
|
||||
@Override
|
||||
public void deregister(HalSensorConfig sensor) {
|
||||
registeredDevices.remove(sensor);
|
||||
public void deregister(HalDeviceConfig deviceConfig) {
|
||||
registeredDevices.remove(deviceConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -263,12 +249,8 @@ public class TellstickSerialComm implements Runnable,
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setListener(HalEventReportListener listener) {
|
||||
eventListener = listener;
|
||||
}
|
||||
@Override
|
||||
public void setListener(HalSensorReportListener listener) {
|
||||
sensorListener = listener;
|
||||
public void setListener(HalDeviceReportListener listener) {
|
||||
deviceListener = listener;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -101,11 +101,11 @@ public class NexaSelfLearning implements HalEventConfig,TellstickDevice,Tellstic
|
|||
|
||||
|
||||
@Override
|
||||
public Class<? extends HalEventController> getEventControllerClass() {
|
||||
public Class<? extends HalEventController> getDeviceControllerClass() {
|
||||
return TellstickSerialComm.class;
|
||||
}
|
||||
@Override
|
||||
public Class<? extends HalEventData> getEventDataClass() {
|
||||
public Class<? extends HalEventData> getDeviceDataClass() {
|
||||
return OnOffEventData.class;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -81,11 +81,11 @@ public class NexaSelfLearningDimmer implements HalEventConfig,TellstickDevice {
|
|||
|
||||
|
||||
@Override
|
||||
public Class<? extends HalEventController> getEventControllerClass() {
|
||||
public Class<? extends HalEventController> getDeviceControllerClass() {
|
||||
return TellstickSerialComm.class;
|
||||
}
|
||||
@Override
|
||||
public Class<? extends HalEventData> getEventDataClass() {
|
||||
public Class<? extends HalEventData> getDeviceDataClass() {
|
||||
return DimmerEventData.class;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,12 +73,12 @@ public class Oregon0x1A2D implements HalSensorConfig,TellstickDevice {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends HalSensorController> getSensorControllerClass() {
|
||||
public Class<? extends HalSensorController> getDeviceControllerClass() {
|
||||
return TellstickSerialComm.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends HalSensorData> getSensorDataClass() {
|
||||
public Class<? extends HalSensorData> getDeviceDataClass() {
|
||||
if (sensorType != null) {
|
||||
switch (sensorType) {
|
||||
case HUMIDITY:
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class TelstickSerialCommEventTest {
|
|||
// Setup
|
||||
TellstickSerialComm tellstick = new TellstickSerialComm();
|
||||
final ArrayList<HalEventConfig> list = new ArrayList<>();
|
||||
tellstick.setListener(new HalEventReportListener() {
|
||||
tellstick.setListener(new HalDeviceReportListener<HalEventConfig,HalEventData>() {
|
||||
@Override
|
||||
public void reportReceived(HalEventConfig e, HalEventData d) {
|
||||
list.add(e);
|
||||
|
|
@ -62,7 +62,7 @@ public class TelstickSerialCommEventTest {
|
|||
// Setup
|
||||
TellstickSerialComm tellstick = new TellstickSerialComm();
|
||||
final ArrayList<HalEventConfig> list = new ArrayList<>();
|
||||
tellstick.setListener(new HalEventReportListener() {
|
||||
tellstick.setListener(new HalDeviceReportListener<HalEventConfig,HalEventData>() {
|
||||
@Override
|
||||
public void reportReceived(HalEventConfig e, HalEventData d) {
|
||||
list.add(e);
|
||||
|
|
@ -101,9 +101,9 @@ public class TelstickSerialCommEventTest {
|
|||
|
||||
|
||||
@Override
|
||||
public Class<? extends HalEventController> getEventControllerClass() { return null; }
|
||||
public Class<? extends HalEventController> getDeviceControllerClass() { return null; }
|
||||
@Override
|
||||
public Class<? extends HalEventData> getEventDataClass() {
|
||||
public Class<? extends HalEventData> getDeviceDataClass() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class TelstickSerialCommSensorTest {
|
|||
// Setup
|
||||
TellstickSerialComm tellstick = new TellstickSerialComm();
|
||||
final ArrayList<HalSensorConfig> list = new ArrayList<>();
|
||||
tellstick.setListener(new HalSensorReportListener() {
|
||||
tellstick.setListener(new HalDeviceReportListener<HalSensorConfig,HalSensorData>() {
|
||||
@Override
|
||||
public void reportReceived(HalSensorConfig e, HalSensorData d) {
|
||||
list.add(e);
|
||||
|
|
@ -47,7 +47,7 @@ public class TelstickSerialCommSensorTest {
|
|||
// Setup
|
||||
TellstickSerialComm tellstick = new TellstickSerialComm();
|
||||
final ArrayList<HalSensorConfig> list = new ArrayList<>();
|
||||
tellstick.setListener(new HalSensorReportListener() {
|
||||
tellstick.setListener(new HalDeviceReportListener<HalSensorConfig,HalSensorData>() {
|
||||
@Override
|
||||
public void reportReceived(HalSensorConfig e, HalSensorData d) {
|
||||
list.add(e);
|
||||
|
|
@ -94,9 +94,9 @@ public class TelstickSerialCommSensorTest {
|
|||
@Override
|
||||
public AggregationMethod getAggregationMethod() { return null; }
|
||||
@Override
|
||||
public Class<? extends HalSensorController> getSensorControllerClass() { return null; }
|
||||
public Class<? extends HalSensorController> getDeviceControllerClass() { return null; }
|
||||
@Override
|
||||
public Class<? extends HalSensorData> getSensorDataClass() {
|
||||
public Class<? extends HalSensorData> getDeviceDataClass() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import java.util.logging.Logger;
|
|||
* <p>
|
||||
* Rest documentatiuon for deConz: https://dresden-elektronik.github.io/deconz-rest-doc/
|
||||
*/
|
||||
public class HalDeConzZigbeeController implements HalSensorController, HalEventController, HalAutoScannableController {
|
||||
public class DeConzZigbeeController implements HalSensorController, HalEventController, HalAutoScannableController {
|
||||
private static final Logger logger = LogUtil.getLogger();
|
||||
|
||||
public static final String CONFIG_ZIGBEE_REST_URL = "zigbee.rest_url";
|
||||
|
|
@ -62,17 +62,12 @@ public class HalDeConzZigbeeController implements HalSensorController, HalEventC
|
|||
|
||||
|
||||
@Override
|
||||
public void setListener(HalEventReportListener listener) {
|
||||
public void register(HalDeviceConfig deviceConfig) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(HalEventConfig eventConfig) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deregister(HalEventConfig eventConfig) {
|
||||
public void deregister(HalDeviceConfig deviceConfig) {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -81,19 +76,8 @@ public class HalDeConzZigbeeController implements HalSensorController, HalEventC
|
|||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void register(HalSensorConfig sensorConfig) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deregister(HalSensorConfig sensorConfig) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setListener(HalSensorReportListener listener) {
|
||||
public void setListener(HalDeviceReportListener listener) {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -19,14 +19,14 @@ public interface DeConzRestConfig {
|
|||
* @param deviceType Name of the client application. (required)
|
||||
* @param username Will be used as username. If not specified a random key will be generated. (optional)
|
||||
*/
|
||||
@WSRequestType(HTTP_POST)
|
||||
@WSRequestType(POST)
|
||||
@WSPath("/api")
|
||||
DataNode getAPIKey(String deviceType, String username);
|
||||
|
||||
/**
|
||||
* Deletes an API key so it can no longer be used.
|
||||
*/
|
||||
@WSRequestType(HTTP_DELETE)
|
||||
@WSRequestType(DELETE)
|
||||
@WSPath("/api/{{requestApiKey}}/config/whitelist/{{apikey2}}")
|
||||
DataNode deleteAPIKey(String requestApiKey, String deleteApiKey);
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ public interface DeConzRestConfig {
|
|||
/**
|
||||
* Returns the current gateway configuration.
|
||||
*/
|
||||
@WSRequestType(HTTP_GET)
|
||||
@WSRequestType(GET)
|
||||
@WSPath("/api/{{requestApiKey}}/config")
|
||||
void getConfiguration(String requestApiKey);
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ public interface DeConzRestConfig {
|
|||
/**
|
||||
* Returns the full state of the gateway including all its lights, groups, scenes and schedules.
|
||||
*/
|
||||
@WSRequestType(HTTP_GET)
|
||||
@WSRequestType(GET)
|
||||
@WSPath("/api/{{requestApiKey}}")
|
||||
void getFullState(String requestApiKey);
|
||||
|
||||
|
|
@ -56,14 +56,14 @@ public interface DeConzRestConfig {
|
|||
/**
|
||||
* Returns the newest software version available. Starts the update if available (only on raspberry pi).
|
||||
*/
|
||||
@WSRequestType(HTTP_POST)
|
||||
@WSRequestType(POST)
|
||||
@WSPath("/api/{{requestApiKey}}/config/update")
|
||||
void updateSoftware(String requestApiKey);
|
||||
|
||||
/**
|
||||
* Starts the update firmware process if newer firmware is available.
|
||||
*/
|
||||
@WSRequestType(HTTP_POST)
|
||||
@WSRequestType(POST)
|
||||
@WSPath("/api/{{requestApiKey}}/config/updatefirmware")
|
||||
void updateFirmware(String requestApiKey);
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ public interface DeConzRestConfig {
|
|||
* @param resetGW Set the network settings of the gateway to factory new. (optional)
|
||||
* @param deleteDB Delete the Database. (optional)
|
||||
*/
|
||||
@WSRequestType(HTTP_POST)
|
||||
@WSRequestType(POST)
|
||||
@WSPath("/api/{{requestApiKey}}/config/reset")
|
||||
void resetGateway(String requestApiKey, boolean resetGW, boolean deleteDB);
|
||||
|
||||
|
|
@ -85,14 +85,14 @@ public interface DeConzRestConfig {
|
|||
* @param oldHash String The Base64 encoded combination of "username:old password". (required)
|
||||
* @param newHash String The Base64 encoded combination of "username:new password". (required)
|
||||
*/
|
||||
@WSRequestType(HTTP_PUT)
|
||||
@WSRequestType(PUT)
|
||||
@WSPath("/api/{{requestApiKey}}/config/password")
|
||||
void setPassword(String requestApiKey, String username, String oldHash, String newHash);
|
||||
|
||||
/**
|
||||
* Resets the username and password to default ("delight","delight"). Only possible within 10 minutes after gateway start.
|
||||
*/
|
||||
@WSRequestType(HTTP_DELETE)
|
||||
@WSRequestType(DELETE)
|
||||
@WSPath("/api/{{requestApiKey}}/config/password")
|
||||
void resetPassword(String requestApiKey);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,21 +19,21 @@ public interface DeConzRestGroups {
|
|||
*
|
||||
* @param name The name of the new group. (required)
|
||||
*/
|
||||
@WSRequestType(HTTP_POST)
|
||||
@WSRequestType(POST)
|
||||
@WSPath("/api/{{requestApiKey}}/groups")
|
||||
void createGroup(String requestApiKey, String name);
|
||||
|
||||
/**
|
||||
* Returns a list of all groups.
|
||||
*/
|
||||
@WSRequestType(HTTP_GET)
|
||||
@WSRequestType(GET)
|
||||
@WSPath("/api/{{requestApiKey}}/groups")
|
||||
void getGroups(String requestApiKey);
|
||||
|
||||
/**
|
||||
* Returns the full state of a group.
|
||||
*/
|
||||
@WSRequestType(HTTP_GET)
|
||||
@WSRequestType(GET)
|
||||
@WSPath("/api/{{requestApiKey}}/groups/{{groupId}}")
|
||||
void getGroup(String requestApiKey, int groupId);
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ public interface DeConzRestGroups {
|
|||
* @param lightSequence Specify a sorted list of light ids that can be used in apps. optional
|
||||
* @param multiDeviceIds Append the subsequential light ids of multidevices like the FLS-PP if the app should handle that light differently.
|
||||
*/
|
||||
@WSRequestType(HTTP_PUT)
|
||||
@WSRequestType(PUT)
|
||||
@WSPath("/api/{{requestApiKey}}/groups/{{groupId}}")
|
||||
void setGroup(String requestApiKey, int groupId, String name, List lights, boolean hidden, List lightSequence, List multiDeviceIds);
|
||||
|
||||
|
|
@ -65,14 +65,14 @@ public interface DeConzRestGroups {
|
|||
* @param colorLoopSpeed Specifies the speed of a colorloop. 1 = very fast, 255 = very slow (default: 15). This parameter only has an effect when it is called together with effect colorloop. (optional)
|
||||
* @param transitionTime Transition time in 1/10 seconds between two states. (optional)
|
||||
*/
|
||||
@WSRequestType(HTTP_PUT)
|
||||
@WSRequestType(PUT)
|
||||
@WSPath("/api/{{requestApiKey}}/groups/{{groupId}}/action")
|
||||
void setGroupState(String requestApiKey, int groupId, boolean on, boolean toggle, int bri, int hue, int sat, int ct, List xy, String alert, String effect, int colorLoopSpeed, int transitionTime);
|
||||
|
||||
/**
|
||||
* Deletes a group.
|
||||
*/
|
||||
@WSRequestType(HTTP_DELETE)
|
||||
@WSRequestType(DELETE)
|
||||
@WSPath("/api/{{requestApiKey}}/groups/{{groupId}}")
|
||||
void deleteGroup(String requestApiKey, int groupId);
|
||||
|
||||
|
|
|
|||
|
|
@ -17,14 +17,14 @@ public interface DeConzRestLights {
|
|||
/**
|
||||
* Returns a list of all lights.
|
||||
*/
|
||||
@WSRequestType(HTTP_GET)
|
||||
@WSRequestType(GET)
|
||||
@WSPath("/api/{{requestApiKey}}/lights")
|
||||
void getLights(String requestApiKey);
|
||||
|
||||
/**
|
||||
* Returns the full state of a light.
|
||||
*/
|
||||
@WSRequestType(HTTP_GET)
|
||||
@WSRequestType(GET)
|
||||
@WSPath("/api/{{requestApiKey}}/lights/{{lightId}")
|
||||
void getLight(String requestApiKey, int lightId);
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ public interface DeConzRestLights {
|
|||
*
|
||||
* @param name Set the name of the light. (required)
|
||||
*/
|
||||
@WSRequestType(HTTP_PUT)
|
||||
@WSRequestType(PUT)
|
||||
@WSPath("/api/{{requestApiKey}}/lights/{{lightId}")
|
||||
void setLight(String requestApiKey, int lightId, String name);
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ public interface DeConzRestLights {
|
|||
* @param colorLoopSpeed Specifies the speed of a colorloop. 1 = very fast, 255 = very slow (default: 15). This parameter only has an effect when it is called together with effect colorloop. (optional)
|
||||
* @param transitionTime Transition time in 1/10 seconds between two states. (optional)
|
||||
*/
|
||||
@WSRequestType(HTTP_GET)
|
||||
@WSRequestType(GET)
|
||||
@WSPath("/api/{{requestApiKey}}/lights/{{lightId}/state")
|
||||
void setLightState(String requestApiKey, int lightId, boolean on, boolean toggle, int bri, int hue, int sat, int ct, List xy, String alert, String effect, int colorLoopSpeed, int transitionTime);
|
||||
|
||||
|
|
@ -61,21 +61,21 @@ public interface DeConzRestLights {
|
|||
*
|
||||
* @param reset If true sends a network leave command to the light device (may not supported by each manufacturer). (optional)
|
||||
*/
|
||||
@WSRequestType(HTTP_PUT)
|
||||
@WSRequestType(PUT)
|
||||
@WSPath("/api/{{requestApiKey}}/lights/{{lightId}")
|
||||
void deleteLight(String requestApiKey, int lightId, boolean reset);
|
||||
|
||||
/**
|
||||
* Remove the light from all groups it is a member of.
|
||||
*/
|
||||
@WSRequestType(HTTP_DELETE)
|
||||
@WSRequestType(DELETE)
|
||||
@WSPath("/api/{{requestApiKey}}/lights/{{lightId}/groups")
|
||||
void deleteGroups(String requestApiKey, int lightId);
|
||||
|
||||
/**
|
||||
* Remove the light from all scenes it is a member of.
|
||||
*/
|
||||
@WSRequestType(HTTP_DELETE)
|
||||
@WSRequestType(DELETE)
|
||||
@WSPath("/api/{{requestApiKey}}/lights/{{lightId}/scenes")
|
||||
void deleteScenes(String requestApiKey, int lightId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,14 +35,14 @@ public interface DeConzRestRules {
|
|||
/**
|
||||
* Returns a list of all rules. If there are no rules in the system then an empty object {} will be returned.
|
||||
*/
|
||||
@WSRequestType(HTTP_GET)
|
||||
@WSRequestType(GET)
|
||||
@WSPath("/api/{{requestApiKey}}/rules")
|
||||
void getRules(String requestApiKey);
|
||||
|
||||
/**
|
||||
* Returns the rule with the specified id.
|
||||
*/
|
||||
@WSRequestType(HTTP_GET)
|
||||
@WSRequestType(GET)
|
||||
@WSPath("/api/{{requestApiKey}}/rules/{{ruleId}}")
|
||||
void getRule(String requestApiKey, int ruleId);
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ public interface DeConzRestRules {
|
|||
//@WSPath("/api/{{requestApiKey}}/rules/{{ruleId}}")
|
||||
//void setRule(String requestApiKey, int ruleId, String name, int periodic, String status, List actions, List conditions);
|
||||
|
||||
@WSRequestType(HTTP_DELETE)
|
||||
@WSRequestType(DELETE)
|
||||
@WSPath("/api/{{requestApiKey}}/rules/{{ruleId}}")
|
||||
void deleteRule(String requestApiKey, int ruleId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,21 +17,21 @@ public interface DeConzRestScenes {
|
|||
*
|
||||
* @param name The name of the new scene. (required)
|
||||
*/
|
||||
@WSRequestType(HTTP_POST)
|
||||
@WSRequestType(POST)
|
||||
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes")
|
||||
void createScene(String requestApiKey, int groupId, String name);
|
||||
|
||||
/**
|
||||
* Returns a list of all scenes of a group.
|
||||
*/
|
||||
@WSRequestType(HTTP_GET)
|
||||
@WSRequestType(GET)
|
||||
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes")
|
||||
void getScenes(String requestApiKey, int groupId);
|
||||
|
||||
/**
|
||||
* Returns all attributes of a scene.
|
||||
*/
|
||||
@WSRequestType(HTTP_GET)
|
||||
@WSRequestType(GET)
|
||||
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes/{{sceneId}}")
|
||||
void getScene(String requestApiKey, int groupId, int sceneId);
|
||||
|
||||
|
|
@ -40,14 +40,14 @@ public interface DeConzRestScenes {
|
|||
*
|
||||
* @param name Name of the scene. (optional)
|
||||
*/
|
||||
@WSRequestType(HTTP_PUT)
|
||||
@WSRequestType(PUT)
|
||||
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes/{{sceneId}}")
|
||||
void getScene(String requestApiKey, int groupId, int sceneId, String name);
|
||||
|
||||
/**
|
||||
* Stores the current group state in the scene. The actual state of each light in the group will become the lights scene state.
|
||||
*/
|
||||
@WSRequestType(HTTP_PUT)
|
||||
@WSRequestType(PUT)
|
||||
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes/{{sceneId}}/store")
|
||||
String storeScene(String requestApiKey, int groupId, int sceneId);
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ public interface DeConzRestScenes {
|
|||
* Recalls a scene. The actual state of each light in the group will become the lights scene state stored in each light.
|
||||
* Note: Lights which are not reachable (turned off) won’t be affected!
|
||||
*/
|
||||
@WSRequestType(HTTP_PUT)
|
||||
@WSRequestType(PUT)
|
||||
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes/{{sceneId}}/recall")
|
||||
void recallScene(String requestApiKey, int groupId, int sceneId);
|
||||
|
||||
|
|
@ -68,14 +68,14 @@ public interface DeConzRestScenes {
|
|||
* @param xy Set the CIE xy color space coordinates as array [x, y] of real values (0..1). optional
|
||||
* @param transitionTime Transition time in 1/10 seconds between two states. (optional)
|
||||
*/
|
||||
@WSRequestType(HTTP_PUT)
|
||||
@WSRequestType(PUT)
|
||||
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes/{{sceneId}}/state/lights/{{lightId}}/state")
|
||||
void setSceneState(String requestApiKey, int groupId, int sceneId, int lightId, int on, int bri, int xy, int transitionTime);
|
||||
|
||||
/**
|
||||
* Deletes a scene.
|
||||
*/
|
||||
@WSRequestType(HTTP_DELETE)
|
||||
@WSRequestType(DELETE)
|
||||
@WSPath("/api/{{requestApiKey}}/groups/{{group_id}}/scenes/{{sceneId}}")
|
||||
void deleteScene(String requestApiKey, int groupId, int sceneId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,14 +34,14 @@ public interface DeConzRestSchedules {
|
|||
/**
|
||||
* Returns a list of all schedules.
|
||||
*/
|
||||
@WSRequestType(HTTP_GET)
|
||||
@WSRequestType(GET)
|
||||
@WSPath("/api/{{requestApiKey}}/schedules")
|
||||
List getSchedules(String requestApiKey);
|
||||
|
||||
/**
|
||||
* Returns all attributes of a schedule.
|
||||
*/
|
||||
@WSRequestType(HTTP_GET)
|
||||
@WSRequestType(GET)
|
||||
@WSPath("/api/{{requestApiKey}}/schedules/{{scheduleId}}")
|
||||
List getSchedule(String requestApiKey, int scheduleId);
|
||||
|
||||
|
|
@ -58,14 +58,14 @@ public interface DeConzRestSchedules {
|
|||
* @param autoDelete If true the schedule will be deleted after triggered. Else it will be disabled. Default is true. (optional)
|
||||
* @param time Time when the schedule shall trigger in UTC ISO 8601:2004 format. (required)
|
||||
*/
|
||||
@WSRequestType(HTTP_PUT)
|
||||
@WSRequestType(PUT)
|
||||
@WSPath("/api/{{requestApiKey}}/schedules/{{scheduleId}}")
|
||||
void setSchedule(String requestApiKey, int scheduleId, String name, String description, List command, String status, boolean autoDelete, String time);
|
||||
|
||||
/**
|
||||
* Returns all attributes of a schedule.
|
||||
*/
|
||||
@WSRequestType(HTTP_DELETE)
|
||||
@WSRequestType(DELETE)
|
||||
@WSPath("/api/{{requestApiKey}}/schedules/{{scheduleId}}")
|
||||
void deleteSchedule(String requestApiKey, int scheduleId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,21 +30,21 @@ public interface DeConzRestSensors {
|
|||
* reachable - Bool - default: true
|
||||
* battery - Number (0..100)
|
||||
*/
|
||||
@WSRequestType(HTTP_POST)
|
||||
@WSRequestType(POST)
|
||||
@WSPath("/api/{{requestApiKey}}/sensors")
|
||||
void createSensor(String requestApiKey, int groupId, String name, String modelid, String swversion, String type, String uniqueid, String manufacturername, Map state, Map config);
|
||||
|
||||
/**
|
||||
* Returns a list of all Sensors. If there are no sensors in the system then an empty object {} will be returned.
|
||||
*/
|
||||
@WSRequestType(HTTP_GET)
|
||||
@WSRequestType(GET)
|
||||
@WSPath("/api/{{requestApiKey}}/sensors")
|
||||
List getSensor(String requestApiKey);
|
||||
|
||||
/**
|
||||
* Returns a list of all Sensors. If there are no sensors in the system then an empty object {} will be returned.
|
||||
*/
|
||||
@WSRequestType(HTTP_GET)
|
||||
@WSRequestType(GET)
|
||||
@WSPath("/api/{{requestApiKey}}/sensors/{{sensorId}}")
|
||||
void getSensor(String requestApiKey, int sensorId);
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ public interface DeConzRestSensors {
|
|||
* 2 = Two groups mode
|
||||
* 3 = Color temperature mode
|
||||
*/
|
||||
@WSRequestType(HTTP_PUT)
|
||||
@WSRequestType(PUT)
|
||||
@WSPath("/api/{{requestApiKey}}/sensors/{{sensorId}}")
|
||||
void setSensor(String requestApiKey, int sensorId, String name, int mode);
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ public interface DeConzRestSensors {
|
|||
* @param reachable The reachable status of the sensor. (optional)
|
||||
* @param battery The current battery state in percent, only for battery powered devices. (optional)
|
||||
*/
|
||||
@WSRequestType(HTTP_PUT)
|
||||
@WSRequestType(PUT)
|
||||
@WSPath("/api/{{requestApiKey}}/sensors/{{sensorId}}/config")
|
||||
void setSensorConfig(String requestApiKey, int sensorId, boolean on, boolean reachable, int battery);
|
||||
|
||||
|
|
@ -84,14 +84,14 @@ public interface DeConzRestSensors {
|
|||
* CLIPGenericStatus status Number
|
||||
* CLIPHumidity humidity Number
|
||||
*/
|
||||
@WSRequestType(HTTP_PUT)
|
||||
@WSRequestType(PUT)
|
||||
@WSPath("/api/{{requestApiKey}}/sensors/{{sensorId}}/state")
|
||||
void setSensorState(String requestApiKey, String flag);
|
||||
|
||||
/**
|
||||
* Delete a sensor.
|
||||
*/
|
||||
@WSRequestType(HTTP_DELETE)
|
||||
@WSRequestType(DELETE)
|
||||
@WSPath("/api/{{requestApiKey}}/sensors/{{sensorId}}/state")
|
||||
void deleteSensor(String requestApiKey, int sensorId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,14 +16,14 @@ public interface DeConzRestTouchlink {
|
|||
* Starts scanning on all channels for devices which are located close to the gateway. The whole scan process will take about 10 seconds.
|
||||
* <p>Note: While scanning is in progress further API requests which require network access aren’t allowed.
|
||||
*/
|
||||
@WSRequestType(HTTP_POST)
|
||||
@WSRequestType(POST)
|
||||
@WSPath("/api/{{requestApiKey}}/touchlink/scan")
|
||||
void startDeviceScan(String requestApiKey);
|
||||
|
||||
/**
|
||||
* Returns the results of a touchlink scan.
|
||||
*/
|
||||
@WSRequestType(HTTP_GET)
|
||||
@WSRequestType(GET)
|
||||
@WSPath("/api/{{requestApiKey}}/touchlink/scan")
|
||||
void getScanResult(String requestApiKey);
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ public interface DeConzRestTouchlink {
|
|||
* Puts a device into identify mode for example a light will blink a few times.
|
||||
* <p>Note: touchlinkId must be one of the indentifiers which are returned in the scan result.
|
||||
*/
|
||||
@WSRequestType(HTTP_POST)
|
||||
@WSRequestType(POST)
|
||||
@WSPath("/api/{{requestApiKey}}/touchlink/{{touchlinkId}}/identify")
|
||||
void identifyDevice(String requestApiKey, int touchlinkId);
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ public interface DeConzRestTouchlink {
|
|||
* Send a reset to factory new request to a device.
|
||||
* <p>Note: touchlinkId must be one of the indentifiers which are returned in the scan result.
|
||||
*/
|
||||
@WSRequestType(HTTP_POST)
|
||||
@WSRequestType(POST)
|
||||
@WSPath("/api/{{requestApiKey}}/touchlink/{{touchlinkId}}/reset")
|
||||
void resetDevice(String requestApiKey, int touchlinkId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import com.zsmartsystems.zigbee.ZigBeeProfileType;
|
|||
import com.zsmartsystems.zigbee.ZigBeeStatus;
|
||||
import com.zsmartsystems.zigbee.app.basic.ZigBeeBasicServerExtension;
|
||||
import com.zsmartsystems.zigbee.app.discovery.ZigBeeDiscoveryExtension;
|
||||
import com.zsmartsystems.zigbee.app.iasclient.ZigBeeIasCieExtension;
|
||||
import com.zsmartsystems.zigbee.app.otaserver.ZigBeeOtaUpgradeExtension;
|
||||
import com.zsmartsystems.zigbee.dongle.cc2531.ZigBeeDongleTiCc2531;
|
||||
import com.zsmartsystems.zigbee.dongle.conbee.ZigBeeDongleConBee;
|
||||
|
|
@ -40,8 +39,7 @@ public class HalZigbeeController implements HalSensorController, HalEventControl
|
|||
private ZigBeeDataStore dataStore;
|
||||
protected ZigBeeNetworkManager networkManager;
|
||||
|
||||
private HalSensorReportListener sensorListener;
|
||||
private HalEventReportListener eventListener;
|
||||
private HalDeviceReportListener deviceListener;
|
||||
private List<AbstractDevice> registeredDevices;
|
||||
|
||||
|
||||
|
|
@ -140,21 +138,13 @@ public class HalZigbeeController implements HalSensorController, HalEventControl
|
|||
// --------------------------
|
||||
|
||||
@Override
|
||||
public void register(HalEventConfig event) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public void register(HalSensorConfig sensor) {
|
||||
public void register(HalDeviceConfig deviceConfig) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deregister(HalEventConfig event) {
|
||||
registeredDevices.remove(event);
|
||||
}
|
||||
@Override
|
||||
public void deregister(HalSensorConfig sensor) {
|
||||
registeredDevices.remove(sensor);
|
||||
public void deregister(HalDeviceConfig deviceConfig) {
|
||||
registeredDevices.remove(deviceConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -168,11 +158,7 @@ public class HalZigbeeController implements HalSensorController, HalEventControl
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setListener(HalEventReportListener listener) {
|
||||
eventListener = listener;
|
||||
}
|
||||
@Override
|
||||
public void setListener(HalSensorReportListener listener) {
|
||||
sensorListener = listener;
|
||||
public void setListener(HalDeviceReportListener listener) {
|
||||
deviceListener = listener;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,10 +4,8 @@ import org.zwave4j.*;
|
|||
import se.hal.HalContext;
|
||||
import se.hal.intf.*;
|
||||
import se.hal.struct.AbstractDevice;
|
||||
import zutil.log.CompactLogFormatter;
|
||||
import zutil.log.LogUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.logging.Logger;
|
||||
|
|
@ -30,8 +28,8 @@ public class HalZWaveController implements HalSensorController, HalEventControll
|
|||
private Options options;
|
||||
private Manager manager;
|
||||
|
||||
private HalSensorReportListener sensorListener;
|
||||
private HalEventReportListener eventListener;
|
||||
private HalDeviceReportListener sensorListener;
|
||||
private HalDeviceReportListener deviceListener;
|
||||
private List<AbstractDevice> registeredDevices;
|
||||
|
||||
|
||||
|
|
@ -303,21 +301,13 @@ public class HalZWaveController implements HalSensorController, HalEventControll
|
|||
// --------------------------
|
||||
|
||||
@Override
|
||||
public void register(HalEventConfig event) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public void register(HalSensorConfig sensor) {
|
||||
public void register(HalDeviceConfig deviceConfig) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deregister(HalEventConfig event) {
|
||||
registeredDevices.remove(event);
|
||||
}
|
||||
@Override
|
||||
public void deregister(HalSensorConfig sensor) {
|
||||
registeredDevices.remove(sensor);
|
||||
public void deregister(HalDeviceConfig deviceConfig) {
|
||||
registeredDevices.remove(deviceConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -331,13 +321,8 @@ public class HalZWaveController implements HalSensorController, HalEventControll
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setListener(HalEventReportListener listener) {
|
||||
eventListener = listener;
|
||||
public void setListener(HalDeviceReportListener listener) {
|
||||
deviceListener = listener;
|
||||
}
|
||||
@Override
|
||||
public void setListener(HalSensorReportListener listener) {
|
||||
sensorListener = listener;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue