Split switch event data into multiple classes
This commit is contained in:
parent
4499824965
commit
6214c01157
23 changed files with 259 additions and 96 deletions
|
|
@ -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":
|
||||
|
|
|
|||
|
|
@ -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":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue