Skip to content

Commit

Permalink
Updated ApplianceControlCluster: added Fridge parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangrimaldi committed Nov 7, 2014
1 parent 1c00a4d commit c9a313e
Show file tree
Hide file tree
Showing 3 changed files with 172 additions and 0 deletions.
Expand Up @@ -255,6 +255,48 @@ public int getTemperatureTarget1(IEndPointRequestContext context)
public short getSpin(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
// TODO Auto-generated method stub
return 0;
}

@Override
public boolean getEcoMode(IEndPointRequestContext context) throws ApplianceException,
ServiceClusterException {
// TODO Auto-generated method stub
return false;
}

@Override
public boolean getNormalMode(IEndPointRequestContext context) throws ApplianceException,
ServiceClusterException {
// TODO Auto-generated method stub
return false;
}

@Override
public boolean getHolidayMode(IEndPointRequestContext context) throws ApplianceException,
ServiceClusterException {
// TODO Auto-generated method stub
return false;
}

@Override
public boolean getIceParty(IEndPointRequestContext context) throws ApplianceException,
ServiceClusterException {
// TODO Auto-generated method stub
return false;
}

@Override
public boolean getSuperCoolMode(IEndPointRequestContext context) throws ApplianceException,
ServiceClusterException {
// TODO Auto-generated method stub
return false;
}

@Override
public boolean getSuperFreezeMode(IEndPointRequestContext context) throws ApplianceException,
ServiceClusterException {
// TODO Auto-generated method stub
return false;
}
};
}
Expand Down
Expand Up @@ -30,6 +30,13 @@ public interface ApplianceControlServer {
final static String ATTR_TemperatureTarget0_NAME = "TemperatureTarget0";
final static String ATTR_TemperatureTarget1_NAME = "TemperatureTarget1";
final static String ATTR_Spin_NAME = "Spin";
final static String ATTR_SuperCoolMode_NAME = "SuperCoolMode";
final static String ATTR_SuperFreezeMode_NAME = "SuperFreezeMode";
final static String ATTR_NormalMode_NAME = "NormalMode";
final static String ATTR_EcoMode_NAME="EcoMode";
final static String ATTR_HolidayMode_NAME = "HolidayMode";
final static String ATTR_IceParty_NAME = "IceParty";

final static String CMD_CommandExecution_NAME = "CommandExecution";
final static String CMD_SignalState_NAME = "SignalState";
final static String CMD_WriteFunctions_NAME = "WriteFunctions";
Expand Down Expand Up @@ -72,4 +79,15 @@ public void execOverloadWarning(short WarningEvent, IEndPointRequestContext cont

public short getSpin(IEndPointRequestContext context) throws ApplianceException,ServiceClusterException;

public boolean getEcoMode(IEndPointRequestContext context) throws ApplianceException,ServiceClusterException;

public boolean getNormalMode(IEndPointRequestContext context) throws ApplianceException,ServiceClusterException;

public boolean getHolidayMode(IEndPointRequestContext context) throws ApplianceException,ServiceClusterException;

public boolean getIceParty(IEndPointRequestContext context) throws ApplianceException,ServiceClusterException;

public boolean getSuperCoolMode(IEndPointRequestContext context) throws ApplianceException,ServiceClusterException;

public boolean getSuperFreezeMode(IEndPointRequestContext context) throws ApplianceException,ServiceClusterException;
}
Expand Up @@ -36,6 +36,7 @@
import org.energy_home.jemma.ah.zigbee.zcl.ZclValidationException;
import org.energy_home.jemma.ah.zigbee.zcl.lib.ZclServiceCluster;
import org.energy_home.jemma.ah.zigbee.zcl.lib.types.ZclAbstractDataType;
import org.energy_home.jemma.ah.zigbee.zcl.lib.types.ZclDataTypeBoolean;
import org.energy_home.jemma.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
import org.energy_home.jemma.ah.zigbee.zcl.lib.types.ZclDataTypeI16;
import org.energy_home.jemma.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
Expand Down Expand Up @@ -65,6 +66,19 @@ public class ZclApplianceControlServer extends ZclServiceCluster implements Appl
ATTR_TemperatureTarget1_NAME, new ZclDataTypeI16(), null, true, 1));
attributesMapByName.put(ATTR_Spin_NAME, new ZclAttributeDescriptor(10, //spin attribute id: 0x000a
ATTR_Spin_NAME, new ZclDataTypeI16(), null, true, 1));
attributesMapByName.put(ATTR_SuperCoolMode_NAME, new ZclAttributeDescriptor(11, //SuperCoolMode attribute id: 0x000b
ATTR_SuperCoolMode_NAME, new ZclDataTypeBoolean(), null, true, 1));
attributesMapByName.put(ATTR_SuperFreezeMode_NAME, new ZclAttributeDescriptor(12, //SuperFreezeMode attribute id: 0x000c
ATTR_SuperFreezeMode_NAME, new ZclDataTypeBoolean(), null, true, 1));
attributesMapByName.put(ATTR_NormalMode_NAME, new ZclAttributeDescriptor(13, //NormalMode attribute id: 0x000d
ATTR_NormalMode_NAME, new ZclDataTypeBoolean(), null, true, 1));
attributesMapByName.put(ATTR_EcoMode_NAME, new ZclAttributeDescriptor(14, //EcoMode attribute id: 0x000e
ATTR_EcoMode_NAME, new ZclDataTypeBoolean(), null, true, 1));
attributesMapByName.put(ATTR_HolidayMode_NAME, new ZclAttributeDescriptor(15, //EcoMode attribute id: 0x000f
ATTR_HolidayMode_NAME, new ZclDataTypeBoolean(), null, true, 1));
attributesMapByName.put(ATTR_IceParty_NAME, new ZclAttributeDescriptor(20, //IceParty attribute id: 0x0014
ATTR_IceParty_NAME, new ZclDataTypeBoolean(), null, true, 1));

}

public ZclApplianceControlServer() throws ApplianceException {
Expand Down Expand Up @@ -308,4 +322,102 @@ public short getSpin(IEndPointRequestContext context) throws ApplianceException,
return v.shortValue();
}

@Override
public boolean getEcoMode(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
if (context != null) {
Boolean objectResult = null;
objectResult = ((Boolean) getValidCachedAttributeObject(14 //EcoMode attribute ID: 0x000e
, context.getMaxAgeForAttributeValues()));
if (objectResult != null) {
return objectResult;
}
}
IZclFrame zclFrame = readAttribute(14, context);//EcoMode attribute ID: 0x000e
Boolean v = ZclDataTypeBoolean.zclParse(zclFrame);
setCachedAttributeObject(14, v);
return v;
}

@Override
public boolean getNormalMode(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
if (context != null) {
Boolean objectResult = null;
objectResult = ((Boolean) getValidCachedAttributeObject(13 //NormalMode attribute ID: 0x000d
, context.getMaxAgeForAttributeValues()));
if (objectResult != null) {
return objectResult;
}
}
IZclFrame zclFrame = readAttribute(13, context);//NormalMode attribute ID: 0x000d
Boolean v = ZclDataTypeBoolean.zclParse(zclFrame);
setCachedAttributeObject(13, v);
return v;
}

@Override
public boolean getHolidayMode(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
if (context != null) {
Boolean objectResult = null;
objectResult = ((Boolean) getValidCachedAttributeObject(15 //HolidayMode attribute ID: 0x000f
, context.getMaxAgeForAttributeValues()));
if (objectResult != null) {
return objectResult;
}
}
IZclFrame zclFrame = readAttribute(15, context);//HolidayMode attribute ID: 0x000f
Boolean v = ZclDataTypeBoolean.zclParse(zclFrame);
setCachedAttributeObject(15, v);
return v;
}

@Override
public boolean getIceParty(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
if (context != null) {
Boolean objectResult = null;
objectResult = ((Boolean) getValidCachedAttributeObject(20 //IceParty attribute ID: 0x0014
, context.getMaxAgeForAttributeValues()));
if (objectResult != null) {
return objectResult;
}
}
IZclFrame zclFrame = readAttribute(20, context);//IceParty attribute ID: 0x0014
Boolean v = ZclDataTypeBoolean.zclParse(zclFrame);
setCachedAttributeObject(20, v);
return v;
}

@Override
public boolean getSuperCoolMode(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
if (context != null) {
Boolean objectResult = null;
objectResult = ((Boolean) getValidCachedAttributeObject(11 //SuperCool attribute ID: 0x000b
, context.getMaxAgeForAttributeValues()));
if (objectResult != null) {
return objectResult;
}
}
IZclFrame zclFrame = readAttribute(11, context); //SuperCool attribute ID: 0x000b
Boolean v = ZclDataTypeBoolean.zclParse(zclFrame);
setCachedAttributeObject(11, v);
return v;
}

@Override
public boolean getSuperFreezeMode(IEndPointRequestContext context) throws ApplianceException,
ServiceClusterException {
if (context != null) {
Boolean objectResult = null;
objectResult = ((Boolean) getValidCachedAttributeObject(12 //SuperFreeze attribute ID: 0x000c
, context.getMaxAgeForAttributeValues()));
if (objectResult != null) {
return objectResult;
}
}
IZclFrame zclFrame = readAttribute(12, context); //SuperFreeze attribute ID: 0x000c
Boolean v = ZclDataTypeBoolean.zclParse(zclFrame);
setCachedAttributeObject(12,v);
return v;

}

}

0 comments on commit c9a313e

Please sign in to comment.