Bugfix for devices that do not have any data yet
This commit is contained in:
parent
c46aab31e9
commit
0b029f68e3
3 changed files with 5 additions and 6 deletions
|
|
@ -40,10 +40,10 @@ public class DeviceTraitFactory {
|
||||||
|
|
||||||
|
|
||||||
public static DeviceTrait[] getTraits(HalAbstractDevice device) {
|
public static DeviceTrait[] getTraits(HalAbstractDevice device) {
|
||||||
if (device == null || device.getDeviceData() == null)
|
if (device == null || device.getDeviceConfig() == null)
|
||||||
return new DeviceTrait[0];
|
return new DeviceTrait[0];
|
||||||
|
|
||||||
switch (device.getDeviceData().getClass().getName()) {
|
switch (device.getDeviceConfig().getDeviceDataClass().getName()) {
|
||||||
case "se.hal.struct.devicedata.DimmerEventData":
|
case "se.hal.struct.devicedata.DimmerEventData":
|
||||||
case "se.hal.struct.devicedata.OnOffEventData":
|
case "se.hal.struct.devicedata.OnOffEventData":
|
||||||
return new DeviceTrait[]{new OnOffTrait()};
|
return new DeviceTrait[]{new OnOffTrait()};
|
||||||
|
|
|
||||||
|
|
@ -148,10 +148,10 @@ public enum DeviceType {
|
||||||
|
|
||||||
|
|
||||||
public static DeviceType getType(HalAbstractDevice device) {
|
public static DeviceType getType(HalAbstractDevice device) {
|
||||||
if (device == null || device.getDeviceData() == null)
|
if (device == null || device.getDeviceConfig() == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
switch (device.getDeviceData().getClass().getName()) {
|
switch (device.getDeviceConfig().getDeviceDataClass().getName()) {
|
||||||
case "se.hal.struct.devicedata.DimmerEventData":
|
case "se.hal.struct.devicedata.DimmerEventData":
|
||||||
case "se.hal.struct.devicedata.OnOffEventData":
|
case "se.hal.struct.devicedata.OnOffEventData":
|
||||||
return LIGHT;
|
return LIGHT;
|
||||||
|
|
|
||||||
|
|
@ -395,8 +395,7 @@ public class ZigbeeController implements HalSensorController,
|
||||||
logger.info("Starting Zigbee pairing process.");
|
logger.info("Starting Zigbee pairing process.");
|
||||||
|
|
||||||
networkManager.permitJoin(120);
|
networkManager.permitJoin(120);
|
||||||
permitJoinTimer = new Timer(120_000);
|
permitJoinTimer = new Timer(120_000).start();
|
||||||
permitJoinTimer.start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue