Skip to content

Commit

Permalink
Align naming in Thermostat cluster XML with the spec.
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple committed Jan 24, 2023
1 parent 7eda58b commit 832807d
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void ProcessThermostatUnicastBindingCommand(BindingCommandData * data, const Emb
switch (data->commandId)
{
case Clusters::Thermostat::Commands::SetpointRaiseLower::Id:
setpointRaiseLowerCommand.mode = static_cast<EmberAfSetpointAdjustMode>(data->args[0]);
setpointRaiseLowerCommand.mode = static_cast<Clusters::Thermostat::SetpointAdjustMode>(data->args[0]);
setpointRaiseLowerCommand.amount = static_cast<int8_t>(data->args[1]);
Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote,
setpointRaiseLowerCommand, onSuccess, onFailure);
Expand All @@ -171,7 +171,7 @@ void ProcessThermostatGroupBindingCommand(BindingCommandData * data, const Ember
switch (data->commandId)
{
case Clusters::Thermostat::Commands::SetpointRaiseLower::Id:
setpointRaiseLowerCommand.mode = static_cast<EmberAfSetpointAdjustMode>(data->args[0]);
setpointRaiseLowerCommand.mode = static_cast<Clusters::Thermostat::SetpointAdjustMode>(data->args[0]);
setpointRaiseLowerCommand.amount = static_cast<int8_t>(data->args[1]);
Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, setpointRaiseLowerCommand);
break;
Expand Down
10 changes: 4 additions & 6 deletions src/app/clusters/thermostat-server/thermostat-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ MatterThermostatClusterServerPreAttributeChangedCallback(const app::ConcreteAttr
case ThermostatControlSequence::kCoolingOnly:
case ThermostatControlSequence::kCoolingWithReheat:
if (RequestedSystemMode == ThermostatSystemMode::kHeat ||
RequestedSystemMode == ThermostatSystemMode::kEmergencyHeating)
RequestedSystemMode == ThermostatSystemMode::kEmergencyHeat)
return imcode::InvalidValue;
else
return imcode::Success;
Expand Down Expand Up @@ -381,8 +381,6 @@ bool emberAfThermostatClusterSetWeeklyScheduleCallback(app::CommandHandler * com
return false;
}

using namespace chip::app::Clusters::Thermostat::Attributes;

int16_t EnforceHeatingSetpointLimits(int16_t HeatingSetpoint, EndpointId endpoint)
{
// Optional Mfg supplied limits
Expand Down Expand Up @@ -565,7 +563,7 @@ bool emberAfThermostatClusterSetpointRaiseLowerCallback(app::CommandHandler * co

switch (mode)
{
case EMBER_ZCL_SETPOINT_ADJUST_MODE_HEAT_AND_COOL_SETPOINTS:
case SetpointAdjustMode::kBoth:
if (HeatSupported && CoolSupported)
{
int16_t DesiredCoolingSetpoint, CoolLimit, DesiredHeatingSetpoint, HeatLimit;
Expand Down Expand Up @@ -645,7 +643,7 @@ bool emberAfThermostatClusterSetpointRaiseLowerCallback(app::CommandHandler * co
status = EMBER_ZCL_STATUS_SUCCESS;
break;

case EMBER_ZCL_SETPOINT_ADJUST_MODE_COOL_SETPOINT:
case SetpointAdjustMode::kCool:
if (CoolSupported)
{
if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
Expand Down Expand Up @@ -698,7 +696,7 @@ bool emberAfThermostatClusterSetpointRaiseLowerCallback(app::CommandHandler * co
status = EMBER_ZCL_STATUS_INVALID_COMMAND;
break;

case EMBER_ZCL_SETPOINT_ADJUST_MODE_HEAT_SETPOINT:
case SetpointAdjustMode::kHeat:
if (HeatSupported)
{
if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS)
Expand Down
1 change: 0 additions & 1 deletion src/app/common/templates/weak-enum-list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
- SaturationMoveMode
- SaturationStepMode
- SecurityType
- SetpointAdjustMode
- StartUpOnOffValue
- StatusCode
- StepMode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,15 @@ limitations under the License.
<field name="Heating" mask="0x1"/>
<field name="Cooling" mask="0x2"/>
<field name="Occupancy" mask="0x4"/>
<field name="Schedule" mask="0x8"/>
<field name="ScheduleConfiguration" mask="0x8"/>
<field name="Setback" mask="0x10"/>
<field name="Automode" mask="0x20"/>
<field name="AutoMode" mask="0x20"/>
</bitmap>

<struct name="ThermostatScheduleTransition">
<cluster code="0x0201"/>
<item fieldId="0" name="TransitionTime" type="INT16U"/>
<!-- See https://github.com/CHIP-Specifications/connectedhomeip-spec/issues/5238 for HeatSetpoint and CoolSetpoint. For now, going to guess they are in fact meant to be nullable. -->
<!-- See https://github.com/CHIP-Specifications/connectedhomeip-spec/issues/6217 for HeatSetpoint and CoolSetpoint. They might end up being nullable. -->
<item fieldId="1" name="HeatSetpoint" type="INT16S" isNullable="true"/>
<item fieldId="2" name="CoolSetpoint" type="INT16S" isNullable="true"/>
</struct>
Expand Down
40 changes: 21 additions & 19 deletions src/app/zap-templates/zcl/data-model/silabs/types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,28 +144,30 @@ limitations under the License.
</enum>
<enum name="ThermostatControlSequence" type="ENUM8">
<cluster code="0x0201"/>
<item name="coolingOnly" value="0x0"/>
<item name="coolingWithReheat" value="0x1"/>
<item name="heatingOnly" value="0x2"/>
<item name="heatingWithReheat" value="0x3"/>
<item name="coolingAndHeating" value="0x4"/>
<item name="coolingAndHeatingWithReheat" value="0x5"/>
<item name="CoolingOnly" value="0x0"/>
<item name="CoolingWithReheat" value="0x1"/>
<item name="HeatingOnly" value="0x2"/>
<item name="HeatingWithReheat" value="0x3"/>
<item name="CoolingAndHeating" value="0x4"/>
<item name="CoolingAndHeatingWithReheat" value="0x5"/>
</enum>
<enum name="ThermostatSystemMode" type="ENUM8">
<cluster code="0x0201"/>
<item name="off" value="0x0"/>
<item name="auto" value="0x1"/>
<item name="cool" value="0x3"/>
<item name="heat" value="0x4"/>
<item name="emergencyHeating" value="0x5"/>
<item name="precooling" value="0x6"/>
<item name="fanOnly" value="0x7"/>
<item name="Off" value="0x0"/>
<item name="Auto" value="0x1"/>
<item name="Cool" value="0x3"/>
<item name="Heat" value="0x4"/>
<item name="EmergencyHeat" value="0x5"/>
<item name="Precooling" value="0x6"/>
<item name="FanOnly" value="0x7"/>
<item name="Dry" value="0x8"/>
<item name="Sleep" value="0x9"/>
</enum>
<enum name="SetpointAdjustMode" type="ENUM8">
<cluster code="0x0201"/>
<item name="heatSetpoint" value="0x0"/>
<item name="coolSetpoint" value="0x1"/>
<item name="heatAndCoolSetpoints" value="0x2"/>
<item name="Heat" value="0x0"/>
<item name="Cool" value="0x1"/>
<item name="Both" value="0x2"/>
</enum>
<enum name="FanMode" type="ENUM8">
<item name="off" value="0x0"/>
Expand Down Expand Up @@ -582,12 +584,12 @@ limitations under the License.
<field name="Thursday" mask="0x10"/>
<field name="Friday" mask="0x20"/>
<field name="Saturday" mask="0x40"/>
<field name="AwayOrVacation" mask="0x80"/>
<field name="Away" mask="0x80"/>
</bitmap>
<bitmap name="ModeForSequence" type="BITMAP8">
<cluster code="0x0201"/>
<field name="HeatSetpointFieldPresent" mask="0x01"/>
<field name="CoolSetpointFieldPresent" mask="0x02"/>
<field name="HeatSetpointPresent" mask="0x01"/>
<field name="CoolSetpointPresent" mask="0x02"/>
</bitmap>
<enum name="ProductTypeId" type="ENUM16">
<item name="WhiteGoods" value="0x0000"/>
Expand Down
50 changes: 50 additions & 0 deletions src/darwin/Framework/CHIP/templates/availability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5622,6 +5622,15 @@
- Percentage
ParameterEnum:
- Video
Thermostat:
ThermostatSystemMode:
- EmergencyHeat
- Dry
- Sleep
SetpointAdjustMode:
- Heat
- Cool
- Both
bitmaps:
UnitTesting:
- Bitmap8MaskMap
Expand Down Expand Up @@ -5700,6 +5709,15 @@
- ConstantTemperature
- Automatic
- Local
Thermostat:
ThermostatFeature:
- ScheduleConfiguration
- AutoMode
DayOfWeek:
- Away
ModeForSequence:
- HeatSetpointPresent
- CoolSetpointPresent
deprecated:
clusters:
- OtaSoftwareUpdateProvider
Expand Down Expand Up @@ -5925,6 +5943,13 @@
MetricTypeEnum:
- PIXELS
- PERCENTAGE
Thermostat:
ThermostatSystemMode:
- EmergencyHeating
SetpointAdjustMode:
- HeatSetpoint
- CoolSetpoint
- HeatAndCoolSetpoints
bitmaps:
DoorLock:
- DlDaysMaskMap
Expand All @@ -5947,6 +5972,15 @@
- UsersManagement
- Notifications
- YearDaySchedules
Thermostat:
ThermostatFeature:
- Schedule
- Automode
DayOfWeek:
- AwayOrVacation
ModeForSequence:
- HeatSetpointFieldPresent
- CoolSetpointFieldPresent
apis:
- Timed Invoke for server to client commands
- Deprecated global attribute names
Expand Down Expand Up @@ -6244,6 +6278,13 @@
MetricTypeEnum:
Pixels: PIXELS
Percentage: PERCENTAGE
Thermostat:
ThermostatSystemMode:
EmergencyHeat: EmergencyHeating
SetpointAdjustMode:
Heat: HeatSetpoint
Cool: CoolSetpoint
Both: HeatAndCoolSetpoints
bitmaps:
DoorLock:
DaysMaskMap: DlDaysMaskMap
Expand All @@ -6266,3 +6307,12 @@
User: UsersManagement
Notification: Notifications
YearDayAccessSchedules: YearDaySchedules
Thermostat:
ThermostatFeature:
ScheduleConfiguration: Schedule
AutoMode: Automode
DayOfWeek:
Away: AwayOrVacation
ModeForSequence:
HeatSetpointPresent: HeatSetpointFieldPresent
CoolSetpointPresent: CoolSetpointFieldPresent

0 comments on commit 832807d

Please sign in to comment.