Split switch event data into multiple classes

This commit is contained in:
Ziver Koc 2021-01-02 04:25:04 +01:00
parent 4499824965
commit 6214c01157
23 changed files with 259 additions and 96 deletions

View file

@ -40,7 +40,7 @@ public class DeviceTraitFactory {
public static DeviceTrait[] getTraits(Sensor sensor) {
switch (sensor.getDeviceData().getClass().getName()) {
case "se.hal.struct.devicedata.DimmerEventData":
case "se.hal.struct.devicedata.SwitchEventData":
case "se.hal.struct.devicedata.OnOffEventData":
return new DeviceTrait[]{};
case "se.hal.struct.devicedata.PowerConsumptionSensorData":

View file

@ -149,7 +149,7 @@ public enum DeviceType {
public static DeviceType getType(Sensor sensor) {
switch (sensor.getDeviceData().getClass().getName()) {
case "se.hal.struct.devicedata.DimmerEventData":
case "se.hal.struct.devicedata.SwitchEventData":
case "se.hal.struct.devicedata.OnOffEventData":
return LIGHT;
case "se.hal.struct.devicedata.PowerConsumptionSensorData":