Renamed some DeviceData classes, added additional data classes also and better handling in zigbee

This commit is contained in:
Ziver Koc 2021-10-02 19:42:23 +02:00
parent dc200294be
commit 3edea58f8c
18 changed files with 275 additions and 45 deletions

View file

@ -7,7 +7,7 @@ import se.hal.plugin.tellstick.TellstickDevice;
import se.hal.plugin.tellstick.TellstickSerialComm;
import se.hal.plugin.tellstick.protocol.Oregon0x1A2DProtocol;
import se.hal.struct.devicedata.HumiditySensorData;
import se.hal.struct.devicedata.LightSensorData;
import se.hal.struct.devicedata.IlluminanceSensorData;
import se.hal.struct.devicedata.PowerConsumptionSensorData;
import se.hal.struct.devicedata.TemperatureSensorData;
import zutil.log.LogUtil;
@ -78,7 +78,7 @@ public class Oregon0x1A2D implements TellstickDevice, HalSensorConfig {
case HUMIDITY:
return HumiditySensorData.class;
case LIGHT:
return LightSensorData.class;
return IlluminanceSensorData.class;
case POWER:
return PowerConsumptionSensorData.class;
case TEMPERATURE:

View file

@ -6,7 +6,7 @@ import se.hal.plugin.tellstick.TellstickSerialComm;
import se.hal.plugin.tellstick.device.Oregon0x1A2D;
import se.hal.plugin.tellstick.device.Oregon0x1A2D.OregonSensorType;
import se.hal.struct.devicedata.HumiditySensorData;
import se.hal.struct.devicedata.LightSensorData;
import se.hal.struct.devicedata.IlluminanceSensorData;
import se.hal.struct.devicedata.PowerConsumptionSensorData;
import se.hal.struct.devicedata.TemperatureSensorData;
import zutil.converter.Converter;
@ -90,7 +90,7 @@ public class Oregon0x1A2DProtocol extends TellstickProtocol {
humidityFound = true;
break;
case LIGHT:
dataObj = new LightSensorData(temperature, timestamp);
dataObj = new IlluminanceSensorData(temperature, timestamp);
temperatureFound = true;
break;
case TEMPERATURE:

View file

@ -29,7 +29,7 @@ public class TelstickSerialCommNexaOnOffTest {
System.out.println("Up and Running");
while (true) {
Thread.sleep(2000);
nexaData.turnOn();
nexaData.setOn();
nexaDevice.setUnit(0);
comm.send(nexaDevice, nexaData);
Thread.sleep(2000);
@ -38,7 +38,7 @@ public class TelstickSerialCommNexaOnOffTest {
Thread.sleep(2000);
nexaData.turnOff();
nexaData.setOff();
nexaDevice.setUnit(0);
comm.send(nexaDevice, nexaData);
Thread.sleep(2000);