diff --git a/com.zsmartsystems.zigbee.autocode/src/main/resources/0406_OccupancySensing.xml b/com.zsmartsystems.zigbee.autocode/src/main/resources/0406_OccupancySensing.xml index 0e565f66db..493d275f16 100644 --- a/com.zsmartsystems.zigbee.autocode/src/main/resources/0406_OccupancySensing.xml +++ b/com.zsmartsystems.zigbee.autocode/src/main/resources/0406_OccupancySensing.xml @@ -7,7 +7,7 @@ The Occupancy attribute is a bitmap. Bit 0 specifies the sensed occupancy as follows: 1 = occupied, 0 = unoccupied. All other bits are reserved. - + Occupancy Sensor Type The OccupancySensorType attribute specifies the type of the occupancy sensor. @@ -28,16 +28,40 @@ The PIRUnoccupiedToOccupiedThreshold attribute is 8 bits in length and specifies the number of movement detection events that must occur in the period PIRUnoccupiedToOccupiedDelay, before the PIR sensor changes to its occupied state. This attribute is mandatory if the PIRUnoccupiedToOccupiedDelay attribute is implemented. - Ultra Sonic Occupied To Unoccupied Delay - The UltraSonicOccupiedToUnoccupiedTime attribute specifies the time delay, in seconds, before the ultrasonic sensor changes to its occupied state when the sensed area becomes unoccupied. This attribute, along with UltraSonicUnoccupiedToOccupiedTime, may be used to reduce sensor 'chatter' when used in an area where occupation changes frequently. + Ultrasonic Occupied To Unoccupied Delay + The UltrasonicOccupiedToUnoccupiedTime attribute specifies the time delay, in seconds, before the ultrasonic sensor changes to its occupied state when the sensed area becomes unoccupied. This attribute, along with UltraSonicUnoccupiedToOccupiedTime, may be used to reduce sensor 'chatter' when used in an area where occupation changes frequently. - Ultra Sonic Unoccupied To Occupied Delay - The UltraSonicUnoccupiedToOccupiedTime attribute specifies the time delay, in seconds, before the ultrasonic sensor changes to its unoccupied state when the sensed area becomes occupied. + Ultrasonic Unoccupied To Occupied Delay + The UltrsonicUnoccupiedToOccupiedTime attribute specifies the time delay, in seconds, before the ultrasonic sensor changes to its unoccupied state when the sensed area becomes occupied. Ultrasonic Unoccupied To Occupied Threshold The UltrasonicUnoccupiedToOccupiedThreshold attribute is 8 bits in length and specifies the number of movement detection events that must occur in the period UltrasonicUnoccupiedToOccupiedDelay, before the Ultrasonic sensor changes to its occupied state. This attribute is mandatory if the UltrasonicUnoccupiedToOccupiedDelay attribute is implemented. + + Physical Contact Occupied To Unoccupied Delay + The PhysicalContactOccupiedToUnoccupiedDelay attribute is 16 bits in length and specifies the time delay, in seconds, before the physical contact occupancy sensor changes to its unoccupied state after detecting the unoccupied event. The value of 0xffff indicates the sensor does not report occupied to unoccupied transition. + + + Physical Contact Unoccupied To Occupied Delay + The PhysicalContactUnoccupiedToOccupiedDelay attribute is 16 bits in length and specifies the time delay, in seconds, before the physical contact sensor changes to its occupied state after the detection of the occupied event. + + + Physical Contact Unoccupied To Occupied Threshold + The PhysicalContactUnoccupiedToOccupiedThreshold attribute is 8 bits in length and specifies the number of movement detection events that must occur in the period PhysicalContactUnoccupiedToOccupiedDelay, before the PIR sensor changes to its occupied state. This attribute is mandatory if the PhysicalContactUnoccupiedToOccupiedDelay attribute is implemented. + + + + Occupancy Sensor Type + + + + + + + + + diff --git a/com.zsmartsystems.zigbee/src/main/java/com/zsmartsystems/zigbee/zcl/clusters/ZclOccupancySensingCluster.java b/com.zsmartsystems.zigbee/src/main/java/com/zsmartsystems/zigbee/zcl/clusters/ZclOccupancySensingCluster.java index 89d0aad0d5..79137a797b 100644 --- a/com.zsmartsystems.zigbee/src/main/java/com/zsmartsystems/zigbee/zcl/clusters/ZclOccupancySensingCluster.java +++ b/com.zsmartsystems.zigbee/src/main/java/com/zsmartsystems/zigbee/zcl/clusters/ZclOccupancySensingCluster.java @@ -27,7 +27,7 @@ *

* Code is auto-generated. Modifications may be overwritten! */ -@Generated(value = "com.zsmartsystems.zigbee.autocode.ZigBeeCodeGenerator", date = "2024-05-18T20:27:57Z") +@Generated(value = "com.zsmartsystems.zigbee.autocode.ZigBeeCodeGenerator", date = "2024-10-12T13:08:25Z") public class ZclOccupancySensingCluster extends ZclCluster { /** * The ZigBee Cluster Library Cluster ID @@ -79,7 +79,7 @@ public class ZclOccupancySensingCluster extends ZclCluster { */ public static final int ATTR_PIRUNOCCUPIEDTOOCCUPIEDTHRESHOLD = 0x0012; /** - * The UltraSonicOccupiedToUnoccupiedTime attribute specifies the time delay, in + * The UltrasonicOccupiedToUnoccupiedTime attribute specifies the time delay, in * seconds, before the ultrasonic sensor changes to its occupied state when the sensed * area becomes unoccupied. This attribute, along with * UltraSonicUnoccupiedToOccupiedTime, may be used to reduce sensor 'chatter' when @@ -87,7 +87,7 @@ public class ZclOccupancySensingCluster extends ZclCluster { */ public static final int ATTR_ULTRASONICOCCUPIEDTOUNOCCUPIEDDELAY = 0x0020; /** - * The UltraSonicUnoccupiedToOccupiedTime attribute specifies the time delay, in + * The UltrsonicUnoccupiedToOccupiedTime attribute specifies the time delay, in * seconds, before the ultrasonic sensor changes to its unoccupied state when the sensed * area becomes occupied. */ @@ -100,6 +100,27 @@ public class ZclOccupancySensingCluster extends ZclCluster { * UltrasonicUnoccupiedToOccupiedDelay attribute is implemented. */ public static final int ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDTHRESHOLD = 0x0022; + /** + * The PhysicalContactOccupiedToUnoccupiedDelay attribute is 16 bits in length and + * specifies the time delay, in seconds, before the physical contact occupancy sensor + * changes to its unoccupied state after detecting the unoccupied event. The value of + * 0xffff indicates the sensor does not report occupied to unoccupied transition. + */ + public static final int ATTR_PHYSICALCONTACTOCCUPIEDTOUNOCCUPIEDDELAY = 0x0030; + /** + * The PhysicalContactUnoccupiedToOccupiedDelay attribute is 16 bits in length and + * specifies the time delay, in seconds, before the physical contact sensor changes to its + * occupied state after the detection of the occupied event. + */ + public static final int ATTR_PHYSICALCONTACTUNOCCUPIEDTOOCCUPIEDDELAY = 0x0031; + /** + * The PhysicalContactUnoccupiedToOccupiedThreshold attribute is 8 bits in length and + * specifies the number of movement detection events that must occur in the period + * PhysicalContactUnoccupiedToOccupiedDelay, before the PIR sensor changes to its + * occupied state. This attribute is mandatory if the + * PhysicalContactUnoccupiedToOccupiedDelay attribute is implemented. + */ + public static final int ATTR_PHYSICALCONTACTUNOCCUPIEDTOOCCUPIEDTHRESHOLD = 0x0032; @Override protected Map initializeClientAttributes() { @@ -118,9 +139,12 @@ protected Map initializeServerAttributes() { attributeMap.put(ATTR_PIROCCUPIEDTOUNOCCUPIEDDELAY, new ZclAttribute(this, ATTR_PIROCCUPIEDTOUNOCCUPIEDDELAY, "PIR Occupied To Unoccupied Delay", ZclDataType.UNSIGNED_16_BIT_INTEGER, false, true, true, false)); attributeMap.put(ATTR_PIRUNOCCUPIEDTOOCCUPIEDDELAY, new ZclAttribute(this, ATTR_PIRUNOCCUPIEDTOOCCUPIEDDELAY, "PIR Unoccupied To Occupied Delay", ZclDataType.UNSIGNED_16_BIT_INTEGER, false, true, true, false)); attributeMap.put(ATTR_PIRUNOCCUPIEDTOOCCUPIEDTHRESHOLD, new ZclAttribute(this, ATTR_PIRUNOCCUPIEDTOOCCUPIEDTHRESHOLD, "PIR Unoccupied To Occupied Threshold", ZclDataType.UNSIGNED_8_BIT_INTEGER, false, true, true, true)); - attributeMap.put(ATTR_ULTRASONICOCCUPIEDTOUNOCCUPIEDDELAY, new ZclAttribute(this, ATTR_ULTRASONICOCCUPIEDTOUNOCCUPIEDDELAY, "Ultra Sonic Occupied To Unoccupied Delay", ZclDataType.UNSIGNED_8_BIT_INTEGER, false, true, true, false)); - attributeMap.put(ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDDELAY, new ZclAttribute(this, ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDDELAY, "Ultra Sonic Unoccupied To Occupied Delay", ZclDataType.UNSIGNED_8_BIT_INTEGER, false, true, true, false)); + attributeMap.put(ATTR_ULTRASONICOCCUPIEDTOUNOCCUPIEDDELAY, new ZclAttribute(this, ATTR_ULTRASONICOCCUPIEDTOUNOCCUPIEDDELAY, "Ultrasonic Occupied To Unoccupied Delay", ZclDataType.UNSIGNED_8_BIT_INTEGER, false, true, true, false)); + attributeMap.put(ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDDELAY, new ZclAttribute(this, ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDDELAY, "Ultrasonic Unoccupied To Occupied Delay", ZclDataType.UNSIGNED_8_BIT_INTEGER, false, true, true, false)); attributeMap.put(ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDTHRESHOLD, new ZclAttribute(this, ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDTHRESHOLD, "Ultrasonic Unoccupied To Occupied Threshold", ZclDataType.UNSIGNED_8_BIT_INTEGER, false, true, true, false)); + attributeMap.put(ATTR_PHYSICALCONTACTOCCUPIEDTOUNOCCUPIEDDELAY, new ZclAttribute(this, ATTR_PHYSICALCONTACTOCCUPIEDTOUNOCCUPIEDDELAY, "Physical Contact Occupied To Unoccupied Delay", ZclDataType.UNSIGNED_8_BIT_INTEGER, false, true, true, false)); + attributeMap.put(ATTR_PHYSICALCONTACTUNOCCUPIEDTOOCCUPIEDDELAY, new ZclAttribute(this, ATTR_PHYSICALCONTACTUNOCCUPIEDTOOCCUPIEDDELAY, "Physical Contact Unoccupied To Occupied Delay", ZclDataType.UNSIGNED_8_BIT_INTEGER, false, true, true, false)); + attributeMap.put(ATTR_PHYSICALCONTACTUNOCCUPIEDTOOCCUPIEDTHRESHOLD, new ZclAttribute(this, ATTR_PHYSICALCONTACTUNOCCUPIEDTOOCCUPIEDTHRESHOLD, "Physical Contact Unoccupied To Occupied Threshold", ZclDataType.UNSIGNED_8_BIT_INTEGER, false, true, true, false)); return attributeMap; } @@ -565,9 +589,9 @@ public Integer getPirUnoccupiedToOccupiedThreshold(final long refreshPeriod) { } /** - * Set the Ultra Sonic Occupied To Unoccupied Delay attribute [attribute ID 0x0020]. + * Set the Ultrasonic Occupied To Unoccupied Delay attribute [attribute ID 0x0020]. *

- * The UltraSonicOccupiedToUnoccupiedTime attribute specifies the time delay, in + * The UltrasonicOccupiedToUnoccupiedTime attribute specifies the time delay, in * seconds, before the ultrasonic sensor changes to its occupied state when the sensed * area becomes unoccupied. This attribute, along with * UltraSonicUnoccupiedToOccupiedTime, may be used to reduce sensor 'chatter' when @@ -577,19 +601,19 @@ public Integer getPirUnoccupiedToOccupiedThreshold(final long refreshPeriod) { *

* The implementation of this attribute by a device is OPTIONAL * - * @param ultraSonicOccupiedToUnoccupiedDelay the {@link Integer} attribute value to be set + * @param ultrasonicOccupiedToUnoccupiedDelay the {@link Integer} attribute value to be set * @return the {@link Future} command result future * @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)} */ @Deprecated - public Future setUltraSonicOccupiedToUnoccupiedDelay(final Integer ultraSonicOccupiedToUnoccupiedDelay) { - return write(serverAttributes.get(ATTR_ULTRASONICOCCUPIEDTOUNOCCUPIEDDELAY), ultraSonicOccupiedToUnoccupiedDelay); + public Future setUltrasonicOccupiedToUnoccupiedDelay(final Integer ultrasonicOccupiedToUnoccupiedDelay) { + return write(serverAttributes.get(ATTR_ULTRASONICOCCUPIEDTOUNOCCUPIEDDELAY), ultrasonicOccupiedToUnoccupiedDelay); } /** - * Get the Ultra Sonic Occupied To Unoccupied Delay attribute [attribute ID 0x0020]. + * Get the Ultrasonic Occupied To Unoccupied Delay attribute [attribute ID 0x0020]. *

- * The UltraSonicOccupiedToUnoccupiedTime attribute specifies the time delay, in + * The UltrasonicOccupiedToUnoccupiedTime attribute specifies the time delay, in * seconds, before the ultrasonic sensor changes to its occupied state when the sensed * area becomes unoccupied. This attribute, along with * UltraSonicUnoccupiedToOccupiedTime, may be used to reduce sensor 'chatter' when @@ -603,14 +627,14 @@ public Future setUltraSonicOccupiedToUnoccupiedDelay(final Intege * @deprecated As of release 1.2.0, replaced by {@link #readAttribute(int attributeId)} */ @Deprecated - public Future getUltraSonicOccupiedToUnoccupiedDelayAsync() { + public Future getUltrasonicOccupiedToUnoccupiedDelayAsync() { return read(serverAttributes.get(ATTR_ULTRASONICOCCUPIEDTOUNOCCUPIEDDELAY)); } /** - * Synchronously get the Ultra Sonic Occupied To Unoccupied Delay attribute [attribute ID 0x0020]. + * Synchronously get the Ultrasonic Occupied To Unoccupied Delay attribute [attribute ID 0x0020]. *

- * The UltraSonicOccupiedToUnoccupiedTime attribute specifies the time delay, in + * The UltrasonicOccupiedToUnoccupiedTime attribute specifies the time delay, in * seconds, before the ultrasonic sensor changes to its occupied state when the sensed * area becomes unoccupied. This attribute, along with * UltraSonicUnoccupiedToOccupiedTime, may be used to reduce sensor 'chatter' when @@ -632,7 +656,7 @@ public Future getUltraSonicOccupiedToUnoccupiedDelayAsync() { * @deprecated As of release 1.2.0, replaced by {@link #ZclAttribute#readValue(long refreshPeriod)} */ @Deprecated - public Integer getUltraSonicOccupiedToUnoccupiedDelay(final long refreshPeriod) { + public Integer getUltrasonicOccupiedToUnoccupiedDelay(final long refreshPeriod) { if (serverAttributes.get(ATTR_ULTRASONICOCCUPIEDTOUNOCCUPIEDDELAY).isLastValueCurrent(refreshPeriod)) { return (Integer) serverAttributes.get(ATTR_ULTRASONICOCCUPIEDTOUNOCCUPIEDDELAY).getLastValue(); } @@ -641,9 +665,9 @@ public Integer getUltraSonicOccupiedToUnoccupiedDelay(final long refreshPeriod) } /** - * Set the Ultra Sonic Unoccupied To Occupied Delay attribute [attribute ID 0x0021]. + * Set the Ultrasonic Unoccupied To Occupied Delay attribute [attribute ID 0x0021]. *

- * The UltraSonicUnoccupiedToOccupiedTime attribute specifies the time delay, in + * The UltrsonicUnoccupiedToOccupiedTime attribute specifies the time delay, in * seconds, before the ultrasonic sensor changes to its unoccupied state when the sensed * area becomes occupied. *

@@ -651,19 +675,19 @@ public Integer getUltraSonicOccupiedToUnoccupiedDelay(final long refreshPeriod) *

* The implementation of this attribute by a device is OPTIONAL * - * @param ultraSonicUnoccupiedToOccupiedDelay the {@link Integer} attribute value to be set + * @param ultrasonicUnoccupiedToOccupiedDelay the {@link Integer} attribute value to be set * @return the {@link Future} command result future * @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)} */ @Deprecated - public Future setUltraSonicUnoccupiedToOccupiedDelay(final Integer ultraSonicUnoccupiedToOccupiedDelay) { - return write(serverAttributes.get(ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDDELAY), ultraSonicUnoccupiedToOccupiedDelay); + public Future setUltrasonicUnoccupiedToOccupiedDelay(final Integer ultrasonicUnoccupiedToOccupiedDelay) { + return write(serverAttributes.get(ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDDELAY), ultrasonicUnoccupiedToOccupiedDelay); } /** - * Get the Ultra Sonic Unoccupied To Occupied Delay attribute [attribute ID 0x0021]. + * Get the Ultrasonic Unoccupied To Occupied Delay attribute [attribute ID 0x0021]. *

- * The UltraSonicUnoccupiedToOccupiedTime attribute specifies the time delay, in + * The UltrsonicUnoccupiedToOccupiedTime attribute specifies the time delay, in * seconds, before the ultrasonic sensor changes to its unoccupied state when the sensed * area becomes occupied. *

@@ -675,14 +699,14 @@ public Future setUltraSonicUnoccupiedToOccupiedDelay(final Intege * @deprecated As of release 1.2.0, replaced by {@link #readAttribute(int attributeId)} */ @Deprecated - public Future getUltraSonicUnoccupiedToOccupiedDelayAsync() { + public Future getUltrasonicUnoccupiedToOccupiedDelayAsync() { return read(serverAttributes.get(ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDDELAY)); } /** - * Synchronously get the Ultra Sonic Unoccupied To Occupied Delay attribute [attribute ID 0x0021]. + * Synchronously get the Ultrasonic Unoccupied To Occupied Delay attribute [attribute ID 0x0021]. *

- * The UltraSonicUnoccupiedToOccupiedTime attribute specifies the time delay, in + * The UltrsonicUnoccupiedToOccupiedTime attribute specifies the time delay, in * seconds, before the ultrasonic sensor changes to its unoccupied state when the sensed * area becomes occupied. *

@@ -702,7 +726,7 @@ public Future getUltraSonicUnoccupiedToOccupiedDelayAsync() { * @deprecated As of release 1.2.0, replaced by {@link #ZclAttribute#readValue(long refreshPeriod)} */ @Deprecated - public Integer getUltraSonicUnoccupiedToOccupiedDelay(final long refreshPeriod) { + public Integer getUltrasonicUnoccupiedToOccupiedDelay(final long refreshPeriod) { if (serverAttributes.get(ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDDELAY).isLastValueCurrent(refreshPeriod)) { return (Integer) serverAttributes.get(ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDDELAY).getLastValue(); } @@ -785,4 +809,223 @@ public Integer getUltrasonicUnoccupiedToOccupiedThreshold(final long refreshPeri return (Integer) readSync(serverAttributes.get(ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDTHRESHOLD)); } + + /** + * Set the Physical Contact Occupied To Unoccupied Delay attribute [attribute ID 0x0030]. + *

+ * The PhysicalContactOccupiedToUnoccupiedDelay attribute is 16 bits in length and + * specifies the time delay, in seconds, before the physical contact occupancy sensor + * changes to its unoccupied state after detecting the unoccupied event. The value of + * 0xffff indicates the sensor does not report occupied to unoccupied transition. + *

+ * The attribute is of type {@link Integer}. + *

+ * The implementation of this attribute by a device is OPTIONAL + * + * @param physicalContactOccupiedToUnoccupiedDelay the {@link Integer} attribute value to be set + * @return the {@link Future} command result future + * @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)} + */ + @Deprecated + public Future setPhysicalContactOccupiedToUnoccupiedDelay(final Integer physicalContactOccupiedToUnoccupiedDelay) { + return write(serverAttributes.get(ATTR_PHYSICALCONTACTOCCUPIEDTOUNOCCUPIEDDELAY), physicalContactOccupiedToUnoccupiedDelay); + } + + /** + * Get the Physical Contact Occupied To Unoccupied Delay attribute [attribute ID 0x0030]. + *

+ * The PhysicalContactOccupiedToUnoccupiedDelay attribute is 16 bits in length and + * specifies the time delay, in seconds, before the physical contact occupancy sensor + * changes to its unoccupied state after detecting the unoccupied event. The value of + * 0xffff indicates the sensor does not report occupied to unoccupied transition. + *

+ * The attribute is of type {@link Integer}. + *

+ * The implementation of this attribute by a device is OPTIONAL + * + * @return the {@link Future} command result future + * @deprecated As of release 1.2.0, replaced by {@link #readAttribute(int attributeId)} + */ + @Deprecated + public Future getPhysicalContactOccupiedToUnoccupiedDelayAsync() { + return read(serverAttributes.get(ATTR_PHYSICALCONTACTOCCUPIEDTOUNOCCUPIEDDELAY)); + } + + /** + * Synchronously get the Physical Contact Occupied To Unoccupied Delay attribute [attribute ID 0x0030]. + *

+ * The PhysicalContactOccupiedToUnoccupiedDelay attribute is 16 bits in length and + * specifies the time delay, in seconds, before the physical contact occupancy sensor + * changes to its unoccupied state after detecting the unoccupied event. The value of + * 0xffff indicates the sensor does not report occupied to unoccupied transition. + *

+ * This method can return cached data if the attribute has already been received. + * The parameter refreshPeriod is used to control this. If the attribute has been received + * within refreshPeriod milliseconds, then the method will immediately return the last value + * received. If refreshPeriod is set to 0, then the attribute will always be updated. + *

+ * This method will block until the response is received or a timeout occurs unless the current value is returned. + *

+ * The attribute is of type {@link Integer}. + *

+ * The implementation of this attribute by a device is OPTIONAL + * + * @param refreshPeriod the maximum age of the data (in milliseconds) before an update is needed + * @return the {@link Integer} attribute value, or null on error + * @deprecated As of release 1.2.0, replaced by {@link #ZclAttribute#readValue(long refreshPeriod)} + */ + @Deprecated + public Integer getPhysicalContactOccupiedToUnoccupiedDelay(final long refreshPeriod) { + if (serverAttributes.get(ATTR_PHYSICALCONTACTOCCUPIEDTOUNOCCUPIEDDELAY).isLastValueCurrent(refreshPeriod)) { + return (Integer) serverAttributes.get(ATTR_PHYSICALCONTACTOCCUPIEDTOUNOCCUPIEDDELAY).getLastValue(); + } + + return (Integer) readSync(serverAttributes.get(ATTR_PHYSICALCONTACTOCCUPIEDTOUNOCCUPIEDDELAY)); + } + + /** + * Set the Physical Contact Unoccupied To Occupied Delay attribute [attribute ID 0x0031]. + *

+ * The PhysicalContactUnoccupiedToOccupiedDelay attribute is 16 bits in length and + * specifies the time delay, in seconds, before the physical contact sensor changes to its + * occupied state after the detection of the occupied event. + *

+ * The attribute is of type {@link Integer}. + *

+ * The implementation of this attribute by a device is OPTIONAL + * + * @param physicalContactUnoccupiedToOccupiedDelay the {@link Integer} attribute value to be set + * @return the {@link Future} command result future + * @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)} + */ + @Deprecated + public Future setPhysicalContactUnoccupiedToOccupiedDelay(final Integer physicalContactUnoccupiedToOccupiedDelay) { + return write(serverAttributes.get(ATTR_PHYSICALCONTACTUNOCCUPIEDTOOCCUPIEDDELAY), physicalContactUnoccupiedToOccupiedDelay); + } + + /** + * Get the Physical Contact Unoccupied To Occupied Delay attribute [attribute ID 0x0031]. + *

+ * The PhysicalContactUnoccupiedToOccupiedDelay attribute is 16 bits in length and + * specifies the time delay, in seconds, before the physical contact sensor changes to its + * occupied state after the detection of the occupied event. + *

+ * The attribute is of type {@link Integer}. + *

+ * The implementation of this attribute by a device is OPTIONAL + * + * @return the {@link Future} command result future + * @deprecated As of release 1.2.0, replaced by {@link #readAttribute(int attributeId)} + */ + @Deprecated + public Future getPhysicalContactUnoccupiedToOccupiedDelayAsync() { + return read(serverAttributes.get(ATTR_PHYSICALCONTACTUNOCCUPIEDTOOCCUPIEDDELAY)); + } + + /** + * Synchronously get the Physical Contact Unoccupied To Occupied Delay attribute [attribute ID 0x0031]. + *

+ * The PhysicalContactUnoccupiedToOccupiedDelay attribute is 16 bits in length and + * specifies the time delay, in seconds, before the physical contact sensor changes to its + * occupied state after the detection of the occupied event. + *

+ * This method can return cached data if the attribute has already been received. + * The parameter refreshPeriod is used to control this. If the attribute has been received + * within refreshPeriod milliseconds, then the method will immediately return the last value + * received. If refreshPeriod is set to 0, then the attribute will always be updated. + *

+ * This method will block until the response is received or a timeout occurs unless the current value is returned. + *

+ * The attribute is of type {@link Integer}. + *

+ * The implementation of this attribute by a device is OPTIONAL + * + * @param refreshPeriod the maximum age of the data (in milliseconds) before an update is needed + * @return the {@link Integer} attribute value, or null on error + * @deprecated As of release 1.2.0, replaced by {@link #ZclAttribute#readValue(long refreshPeriod)} + */ + @Deprecated + public Integer getPhysicalContactUnoccupiedToOccupiedDelay(final long refreshPeriod) { + if (serverAttributes.get(ATTR_PHYSICALCONTACTUNOCCUPIEDTOOCCUPIEDDELAY).isLastValueCurrent(refreshPeriod)) { + return (Integer) serverAttributes.get(ATTR_PHYSICALCONTACTUNOCCUPIEDTOOCCUPIEDDELAY).getLastValue(); + } + + return (Integer) readSync(serverAttributes.get(ATTR_PHYSICALCONTACTUNOCCUPIEDTOOCCUPIEDDELAY)); + } + + /** + * Set the Physical Contact Unoccupied To Occupied Threshold attribute [attribute ID 0x0032]. + *

+ * The PhysicalContactUnoccupiedToOccupiedThreshold attribute is 8 bits in length and + * specifies the number of movement detection events that must occur in the period + * PhysicalContactUnoccupiedToOccupiedDelay, before the PIR sensor changes to its + * occupied state. This attribute is mandatory if the + * PhysicalContactUnoccupiedToOccupiedDelay attribute is implemented. + *

+ * The attribute is of type {@link Integer}. + *

+ * The implementation of this attribute by a device is OPTIONAL + * + * @param physicalContactUnoccupiedToOccupiedThreshold the {@link Integer} attribute value to be set + * @return the {@link Future} command result future + * @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)} + */ + @Deprecated + public Future setPhysicalContactUnoccupiedToOccupiedThreshold(final Integer physicalContactUnoccupiedToOccupiedThreshold) { + return write(serverAttributes.get(ATTR_PHYSICALCONTACTUNOCCUPIEDTOOCCUPIEDTHRESHOLD), physicalContactUnoccupiedToOccupiedThreshold); + } + + /** + * Get the Physical Contact Unoccupied To Occupied Threshold attribute [attribute ID 0x0032]. + *

+ * The PhysicalContactUnoccupiedToOccupiedThreshold attribute is 8 bits in length and + * specifies the number of movement detection events that must occur in the period + * PhysicalContactUnoccupiedToOccupiedDelay, before the PIR sensor changes to its + * occupied state. This attribute is mandatory if the + * PhysicalContactUnoccupiedToOccupiedDelay attribute is implemented. + *

+ * The attribute is of type {@link Integer}. + *

+ * The implementation of this attribute by a device is OPTIONAL + * + * @return the {@link Future} command result future + * @deprecated As of release 1.2.0, replaced by {@link #readAttribute(int attributeId)} + */ + @Deprecated + public Future getPhysicalContactUnoccupiedToOccupiedThresholdAsync() { + return read(serverAttributes.get(ATTR_PHYSICALCONTACTUNOCCUPIEDTOOCCUPIEDTHRESHOLD)); + } + + /** + * Synchronously get the Physical Contact Unoccupied To Occupied Threshold attribute [attribute ID 0x0032]. + *

+ * The PhysicalContactUnoccupiedToOccupiedThreshold attribute is 8 bits in length and + * specifies the number of movement detection events that must occur in the period + * PhysicalContactUnoccupiedToOccupiedDelay, before the PIR sensor changes to its + * occupied state. This attribute is mandatory if the + * PhysicalContactUnoccupiedToOccupiedDelay attribute is implemented. + *

+ * This method can return cached data if the attribute has already been received. + * The parameter refreshPeriod is used to control this. If the attribute has been received + * within refreshPeriod milliseconds, then the method will immediately return the last value + * received. If refreshPeriod is set to 0, then the attribute will always be updated. + *

+ * This method will block until the response is received or a timeout occurs unless the current value is returned. + *

+ * The attribute is of type {@link Integer}. + *

+ * The implementation of this attribute by a device is OPTIONAL + * + * @param refreshPeriod the maximum age of the data (in milliseconds) before an update is needed + * @return the {@link Integer} attribute value, or null on error + * @deprecated As of release 1.2.0, replaced by {@link #ZclAttribute#readValue(long refreshPeriod)} + */ + @Deprecated + public Integer getPhysicalContactUnoccupiedToOccupiedThreshold(final long refreshPeriod) { + if (serverAttributes.get(ATTR_PHYSICALCONTACTUNOCCUPIEDTOOCCUPIEDTHRESHOLD).isLastValueCurrent(refreshPeriod)) { + return (Integer) serverAttributes.get(ATTR_PHYSICALCONTACTUNOCCUPIEDTOOCCUPIEDTHRESHOLD).getLastValue(); + } + + return (Integer) readSync(serverAttributes.get(ATTR_PHYSICALCONTACTUNOCCUPIEDTOOCCUPIEDTHRESHOLD)); + } } diff --git a/com.zsmartsystems.zigbee/src/main/java/com/zsmartsystems/zigbee/zcl/clusters/occupancysensing/OccupancySensorTypeEnum.java b/com.zsmartsystems.zigbee/src/main/java/com/zsmartsystems/zigbee/zcl/clusters/occupancysensing/OccupancySensorTypeEnum.java new file mode 100644 index 0000000000..9a525c57ba --- /dev/null +++ b/com.zsmartsystems.zigbee/src/main/java/com/zsmartsystems/zigbee/zcl/clusters/occupancysensing/OccupancySensorTypeEnum.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2016-2024 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.zcl.clusters.occupancysensing; + +import java.util.HashMap; +import java.util.Map; + +import javax.annotation.Generated; + +/** + * Occupancy Sensor Type value enumeration. + *

+ * Code is auto-generated. Modifications may be overwritten! + */ +@Generated(value = "com.zsmartsystems.zigbee.autocode.ZigBeeCodeGenerator", date = "2024-10-12T13:08:25Z") +public enum OccupancySensorTypeEnum { + + /** + * PIR, 0, 0x0000 + */ + PIR(0x0000), + + /** + * Ultrasonic, 1, 0x0001 + */ + ULTRASONIC(0x0001), + + /** + * PIR and Ultrasonic, 2, 0x0002 + */ + PIR_AND_ULTRASONIC(0x0002), + + /** + * Physical Contact, 3, 0x0003 + */ + PHYSICAL_CONTACT(0x0003); + + /** + * A mapping between the integer code and its corresponding OccupancySensorTypeEnum type to facilitate lookup by value. + */ + private static Map idMap; + + static { + idMap = new HashMap(); + for (OccupancySensorTypeEnum enumValue : values()) { + idMap.put(enumValue.key, enumValue); + } + } + + private final int key; + + private OccupancySensorTypeEnum(final int key) { + this.key = key; + } + + public int getKey() { + return key; + } + + public static OccupancySensorTypeEnum getByValue(final int value) { + return idMap.get(value); + } +}