diff options
Diffstat (limited to 'src/org/traccar/protocol/Gt06ProtocolEncoder.java')
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolEncoder.java | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolEncoder.java b/src/org/traccar/protocol/Gt06ProtocolEncoder.java index 8e00522a7..c20e1108f 100644 --- a/src/org/traccar/protocol/Gt06ProtocolEncoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,13 +56,8 @@ public class Gt06ProtocolEncoder extends BaseProtocolEncoder { @Override protected Object encodeCommand(Command command) { - boolean alternative; - Device device = Context.getIdentityManager().getDeviceById(command.getDeviceId()); - if (device.getAttributes().containsKey("gt06.alternative")) { - alternative = device.getBoolean("gt06.alternative"); - } else { - alternative = Context.getConfig().getBoolean("gt06.alternative"); - } + boolean alternative = Context.getDeviceManager().lookupAttributeBoolean( + command.getDeviceId(), "gt06.alternative", false, true); switch (command.getType()) { case Command.TYPE_ENGINE_STOP: |