Skip to content

Commit f43e152

Browse files
committed
GH-33: Thermostat Fan Control Mode CC
Forwarded: #33 Bug-SiliconLabs: UIC-3061 Bug-Github: #33
1 parent a0e3b84 commit f43e152

11 files changed

+1583
-0
lines changed

applications/zpc/components/zpc_attribute_store/include/attribute_store_defined_attribute_types.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,20 @@ DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_SETPOINT_MAX_VALUE_SCALE,
692692
((COMMAND_CLASS_THERMOSTAT_SETPOINT << 8) | 0x09))
693693

694694
/////////////////////////////////////////////////
695+
// Thermostat Fan Mode Command Class
696+
/// zwave_cc_version_t
697+
DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_FAN_MODE_VERSION,
698+
ZWAVE_CC_VERSION_ATTRIBUTE(COMMAND_CLASS_THERMOSTAT_FAN_MODE))
699+
/// Current Fan mode
700+
DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_FAN_MODE_CURRENT_MODE,
701+
((COMMAND_CLASS_THERMOSTAT_FAN_MODE << 8) | 0x02))
702+
/// Supported Fans modes
703+
DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_FAN_MODE_SUPPORTED_MODES,
704+
((COMMAND_CLASS_THERMOSTAT_FAN_MODE << 8) | 0x03))
705+
/// Off flag (v2+)
706+
DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_FAN_MODE_OFF_FLAG,
707+
((COMMAND_CLASS_THERMOSTAT_FAN_MODE << 8) | 0x05))
708+
/////////////////////////////////////////////////
695709
// Wakeup command class
696710
DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_WAKE_UP_VERSION,
697711
ZWAVE_CC_VERSION_ATTRIBUTE(COMMAND_CLASS_WAKE_UP_V2))
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/******************************************************************************
2+
* # License
3+
* <b>Copyright 2023 Silicon Laboratories Inc. www.silabs.com</b>
4+
******************************************************************************
5+
* The licensor of this software is Silicon Laboratories Inc. Your use of this
6+
* software is governed by the terms of Silicon Labs Master Software License
7+
* Agreement (MSLA) available at
8+
* www.silabs.com/about-us/legal/master-software-license-agreement. This
9+
* software is distributed to you in Source Code format and is governed by the
10+
* sections of the MSLA applicable to Source Code.
11+
*
12+
*****************************************************************************/
13+
14+
/**
15+
* @defgroup zpc_attribute_store_command_classes_types Type definitions for attribute storage of Command Classes
16+
* @ingroup zpc_attribute_store
17+
* @brief Type definitions for Command Classes, used for @ref attribute_store storage.
18+
*
19+
*/
20+
21+
/**
22+
* @defgroup zwave_command_class_thermostat_fan_mode_types Type definitions for attribute storage of the Sound Switch Command Class
23+
* @ingroup zpc_attribute_store_command_classes_types
24+
* @brief Type definitions for the Sound Switch Command Class.
25+
*
26+
* @{
27+
*/
28+
29+
#ifndef ZWAVE_COMMAND_CLASS_THERMOSTAT_FAN_MODE_TYPES_H
30+
#define ZWAVE_COMMAND_CLASS_THERMOSTAT_FAN_MODE_TYPES_H
31+
32+
#include <stdint.h>
33+
34+
35+
// Fan Mode CC
36+
///> Off flag (version >= 2). uint8_t
37+
typedef uint8_t thermostat_fan_mode_off_flag_t;
38+
///> Fan mode. uint8_t
39+
typedef uint8_t thermostat_fan_mode_t;
40+
///> Supported mode bitmask. uint32_t
41+
typedef uint32_t thermostat_fan_supported_modes_t;
42+
43+
// Fan State CC
44+
///> Fan state. uint8_t
45+
typedef uint8_t thermostat_fan_state_t;
46+
47+
#ifdef __cplusplus
48+
extern "C" {
49+
#endif
50+
51+
#ifdef __cplusplus
52+
}
53+
#endif
54+
55+
#endif //ZWAVE_COMMAND_CLASS_THERMOSTAT_FAN_MODE_TYPES_H
56+
/** @} end zwave_command_class_thermostat_fan_mode_types */

applications/zpc/components/zpc_attribute_store/src/zpc_attribute_store_type_registration.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,17 @@ static const std::vector<attribute_schema_t> attribute_schema = {
302302
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_SETPOINT_MIN_VALUE_SCALE, "Min Value Scale", ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_SETPOINT_TYPE, U32_STORAGE_TYPE},
303303
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_SETPOINT_MAX_VALUE, "Max Value", ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_SETPOINT_TYPE, I32_STORAGE_TYPE},
304304
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_SETPOINT_MAX_VALUE_SCALE, "Max Value Scale", ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_SETPOINT_TYPE, U32_STORAGE_TYPE},
305+
306+
307+
/////////////////////////////////////////////////////////////////////
308+
// Thermostat Fan Mode Command Class attributes
309+
/////////////////////////////////////////////////////////////////////
310+
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_FAN_MODE_VERSION, "Thermostat Fan Mode Version", ATTRIBUTE_ENDPOINT_ID, U8_STORAGE_TYPE},
311+
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_FAN_MODE_CURRENT_MODE, "Thermostat Current Fan Mode", ATTRIBUTE_ENDPOINT_ID, U8_STORAGE_TYPE},
312+
// We use u32 since it store some 8bit mask. This should be resilient to future version of Thermostat Fan Mode
313+
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_FAN_MODE_SUPPORTED_MODES, "Thermostat Supported Fan Mode Bitmask", ATTRIBUTE_ENDPOINT_ID, U32_STORAGE_TYPE},
314+
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_FAN_MODE_OFF_FLAG, "Thermostat Fan Off Flag", ATTRIBUTE_ENDPOINT_ID, U8_STORAGE_TYPE },
315+
305316
/////////////////////////////////////////////////////////////////////
306317
// Supervision Command Class attributes
307318
/////////////////////////////////////////////////////////////////////

applications/zpc/components/zwave_command_classes/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ add_library(
4545
src/zwave_command_class_switch_color.c
4646
src/zwave_command_class_switch_multilevel.c
4747
src/zwave_command_class_thermostat_mode.c
48+
src/zwave_command_class_thermostat_fan_mode.c
4849
src/zwave_command_class_thermostat_setpoint.c
4950
src/zwave_command_class_time.c
5051
src/zwave_command_class_user_code.c

0 commit comments

Comments
 (0)