Skip to content

Commit 206d7cf

Browse files
committed
Documentation
1 parent 2943144 commit 206d7cf

File tree

3 files changed

+108
-1
lines changed

3 files changed

+108
-1
lines changed

ZWaveDotNet/CommandClasses/Enums/ThermostatModeType.cs

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,85 @@
1010
// You should have received a copy of the GNU Affero General Public License
1111
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1212

13+
using System;
14+
using System.Text;
15+
1316
namespace ZWaveDotNet.CommandClasses.Enums
1417
{
18+
/// <summary>
19+
/// Thermostat Mode
20+
/// </summary>
1521
public enum ThermostatModeType
1622
{
23+
/// <summary>
24+
/// <b>Version 1</b>: This mode is used to switch off the thermostat.
25+
/// </summary>
1726
OFF = 0x0,
27+
/// <summary>
28+
/// <b>Version 1</b>: This mode is used to use activate heating when the temperature is below the Heating setpoint.
29+
/// </summary>
1830
HEAT = 0x01,
31+
/// <summary>
32+
/// <b>Version 1</b>: This mode is used to use activate cooling when the temperature is above the Cooling setpoint.
33+
/// </summary>
1934
COOL = 0x02,
35+
/// <summary>
36+
/// <b>Version 1</b>: This mode is used to regulate the temperature using heating and cooling
37+
/// when the temperature is outside the range defined by the Heating and Cooling setpoints.
38+
/// </summary>
2039
AUTO = 0x03,
40+
/// <summary>
41+
/// <b>Version 1</b>: This mode is used to activate heating when the temperature is below the Heating setpoint, but using an auxiliary or emergency heat source.
42+
/// </summary>
2143
AUXILIARY = 0x04,
2244
/// <summary>
23-
/// This mode is used to resume the last activate mode (different than OFF 0x00).
45+
/// <b>Version 1</b>: This mode is used to resume the last activate mode (different than OFF).
2446
/// </summary>
2547
RESUME = 0x05,
48+
/// <summary>
49+
/// <b>Version 1</b>: This mode is used to activate fans only and circulate air.
50+
/// </summary>
2651
FAN = 0x06,
52+
/// <summary>
53+
/// <b>Version 1</b>: This mode is used to activate fans to circulate air and heating or cooling
54+
/// will be activated to regulate the temperature at the Furnace setpoint.
55+
/// </summary>
2756
FURNACE = 0x07,
57+
/// <summary>
58+
/// <b>Version 1</b>: This mode is used to dehumidify and remove moisture.
59+
/// </summary>
2860
DRY = 0x08,
61+
/// <summary>
62+
/// <b>Version 1</b>: This mode is used to humidify and add moisture.
63+
/// </summary>
2964
MOIST = 0x09,
65+
/// <summary>
66+
/// <b>Version 1</b>: This mode is used to regulate the temperature at the Auto Changeover setpoint using heating and cooling.
67+
/// </summary>
3068
AUTO_CHANGEOVER = 0x0A,
69+
/// <summary>
70+
/// <b>Version 2</b>: This mode is used to activate heating when the temperature is below the Energy Save Heating setpoint.
71+
/// </summary>
3172
ENERGY_HEAT = 0x0B,
73+
/// <summary>
74+
/// <b>Version 2</b>: This mode is used to activate cooling when the temperature is below the Energy Save Cooling setpoint.
75+
/// </summary>
3276
ENERGY_COOL = 0x0C,
77+
/// <summary>
78+
/// <b>Version 2</b>: This mode is used to regulate the temperature using heating and cooling when the temperature is outside the range defined by the Away Heating and Away Cooling setpoints.
79+
/// </summary>
3380
AWAY_HEATING_OR_BOTH = 0x0D,
81+
/// <summary>
82+
/// <b>Version 3</b>: Away cooling setpoint
83+
/// </summary>
3484
AWAY_COOLING = 0x0E,
85+
/// <summary>
86+
/// <b>Version 3</b>: This mode is used to regulate the temperature at the Full Power setpoint using heating and cooling.
87+
/// </summary>
3588
FULL_POWER = 0x0F,
89+
/// <summary>
90+
/// <b>Version 3</b>: Reserved for vendor specific thermostat mode.
91+
/// </summary>
3692
MANUFACTURER_SPECIFIC = 0x1F
3793
}
3894
}

ZWaveDotNet/CommandClasses/ThermostatMode.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020

2121
namespace ZWaveDotNet.CommandClasses
2222
{
23+
/// <summary>
24+
/// Control which mode a thermostat operates
25+
/// </summary>
2326
[CCVersion(CommandClass.ThermostatMode, 3)]
2427
public class ThermostatMode : CommandClassBase
2528
{
@@ -39,12 +42,25 @@ enum ThermostatModeCommand
3942

4043
internal ThermostatMode(Node node, byte endpoint) : base(node, endpoint, CommandClass.ThermostatMode) { }
4144

45+
/// <summary>
46+
/// <b>Version 1</b>: Request the current mode set at the receiving node
47+
/// </summary>
48+
/// <param name="cancellationToken"></param>
49+
/// <returns></returns>
4250
public async Task<ThermostatModeReport> Get(CancellationToken cancellationToken = default)
4351
{
4452
ReportMessage response = await SendReceive(ThermostatModeCommand.Get, ThermostatModeCommand.Report, cancellationToken);
4553
return new ThermostatModeReport(response.Payload.Span);
4654
}
4755

56+
/// <summary>
57+
/// <b>Version 1</b>: Set the thermostat mode at the receiving node
58+
/// </summary>
59+
/// <param name="value"></param>
60+
/// <param name="manufacturerData"><b>Version 3</b>: This field is used to provide a configuration for the MANUFACTURER SPECIFIC mode</param>
61+
/// <param name="cancellationToken"></param>
62+
/// <returns></returns>
63+
/// <exception cref="ArgumentException"></exception>
4864
public async Task Set(ThermostatModeType value, byte[]? manufacturerData = null, CancellationToken cancellationToken = default)
4965
{
5066
byte[] cmd = new byte[(manufacturerData?.Length ?? 0) + 1];
@@ -61,6 +77,11 @@ public async Task Set(ThermostatModeType value, byte[]? manufacturerData = null,
6177
await SendCommand(ThermostatModeCommand.Set, cancellationToken, cmd);
6278
}
6379

80+
/// <summary>
81+
/// <b>Version 1</b>: Request the supported modes of a node
82+
/// </summary>
83+
/// <param name="cancellationToken"></param>
84+
/// <returns></returns>
6485
public async Task<ThermostatModeType[]> GetSupportedModes(CancellationToken cancellationToken = default)
6586
{
6687
ReportMessage response = await SendReceive(ThermostatModeCommand.SupportedGet, ThermostatModeCommand.SupportedReport, cancellationToken);

ZWaveDotNet/CommandClasses/ThermostatSetpoint.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1212

1313
using System.Collections;
14+
using System.Xml.Linq;
1415
using ZWaveDotNet.CommandClasses.Enums;
1516
using ZWaveDotNet.CommandClassReports;
1617
using ZWaveDotNet.CommandClassReports.Enums;
@@ -21,6 +22,9 @@
2122

2223
namespace ZWaveDotNet.CommandClasses
2324
{
25+
/// <summary>
26+
/// The Thermostat Setpoint Command Class is used to configure setpoints for the modes supported by a thermostat.
27+
/// </summary>
2428
[CCVersion(CommandClass.ThermostatSetpoint, 3)]
2529
public class ThermostatSetpoint : CommandClassBase
2630
{
@@ -42,18 +46,39 @@ enum ThermostatSetpointCommand
4246

4347
internal ThermostatSetpoint(Node node, byte endpoint) : base(node, endpoint, CommandClass.ThermostatSetpoint) { }
4448

49+
/// <summary>
50+
/// <b>Version 1</b>: Request the target value for a given setpoint type that is currently configured at a supporting node.
51+
/// </summary>
52+
/// <param name="type"></param>
53+
/// <param name="cancellationToken"></param>
54+
/// <returns></returns>
4555
public async Task<ThermostatSetpointReport> Get(ThermostatModeType type, CancellationToken cancellationToken = default)
4656
{
4757
ReportMessage response = await SendReceive(ThermostatSetpointCommand.Get, ThermostatSetpointCommand.Report, cancellationToken, (byte)type);
4858
return new ThermostatSetpointReport(response.Payload.Span);
4959
}
5060

61+
/// <summary>
62+
/// <b>Version 3</b>: Request the supported setpoint value range for an actual Setpoint Type
63+
/// </summary>
64+
/// <param name="type"></param>
65+
/// <param name="cancellationToken"></param>
66+
/// <returns></returns>
5167
public async Task<ThermostatSetpointCapabilitiesReport> GetCapabilities(ThermostatModeType type, CancellationToken cancellationToken = default)
5268
{
5369
ReportMessage response = await SendReceive(ThermostatSetpointCommand.CapabilitiesGet, ThermostatSetpointCommand.CapabilitiesReport, cancellationToken, (byte)type);
5470
return new ThermostatSetpointCapabilitiesReport(response.Payload.Span);
5571
}
5672

73+
/// <summary>
74+
/// <b>Version 1</b>: Specify the target value for the specified Setpoint Type at a supporting node.
75+
/// </summary>
76+
/// <param name="type"></param>
77+
/// <param name="value"></param>
78+
/// <param name="unit"></param>
79+
/// <param name="cancellationToken"></param>
80+
/// <returns></returns>
81+
/// <exception cref="ArgumentException"></exception>
5782
public async Task Set(ThermostatModeType type, float value, Units unit, CancellationToken cancellationToken = default)
5883
{
5984
ArraySegment<byte> cmd = new byte[6];
@@ -68,6 +93,11 @@ public async Task Set(ThermostatModeType type, float value, Units unit, Cancella
6893
await SendCommand(ThermostatSetpointCommand.Set, cancellationToken, cmd.Array!);
6994
}
7095

96+
/// <summary>
97+
/// <b>Version 1</b>: Query the supported setpoint types.
98+
/// </summary>
99+
/// <param name="cancellationToken"></param>
100+
/// <returns></returns>
71101
public async Task<ThermostatModeType[]> GetSupportedModes(CancellationToken cancellationToken = default)
72102
{
73103
ReportMessage response = await SendReceive(ThermostatSetpointCommand.SupportedGet, ThermostatSetpointCommand.SupportedReport, cancellationToken);

0 commit comments

Comments
 (0)