Skip to content

Commit 4f56ebb

Browse files
nivi-appleCopilotcjandhyala
authored
Fix the thermostat suggestions tests (project-chip#42568)
* Fix the thermostat suggestions tests * Add PICS code for the new attributes * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Refactor candidate handle generation for presets Refactor preset handle selection logic to use a new naming convention for candidate handles. * Fix typo in assertion message for UTC time check * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix comments and assertions in thermostat test cases * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Restyle fixes * Update src/python_testing/TC_TSTAT_4_3.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * More restyle and lint fixes * Set TemperatureSetpointHoldDuration to null * Fix copilot review comments * Fixes in script * Enable ThermostatSetpointHold and ThermostatSetpointHoldDuration in the all-clusters-app * Set TemperatureSetpointHoldDuration to null as default * Update src/python_testing/TC_TSTAT_4_3.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/python_testing/TC_TSTAT_4_3.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/python_testing/TC_TSTAT_4_3.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/python_testing/TC_TSTAT_4_3.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/python_testing/TC_TSTAT_4_3.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/python_testing/TC_TSTAT_4_3.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update pics_guard check to include additional conditions * Remove Camera related clusters * Update src/python_testing/TC_TSTAT_4_3.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: cjandhyala <68604034+cjandhyala@users.noreply.github.com>
1 parent 100fbbd commit 4f56ebb

7 files changed

Lines changed: 542 additions & 141 deletions

File tree

examples/all-clusters-app/all-clusters-common/all-clusters-app.matter

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8196,6 +8196,8 @@ endpoint 1 {
81968196
ram attribute minSetpointDeadBand default = 0x19;
81978197
ram attribute controlSequenceOfOperation default = 0x04;
81988198
ram attribute systemMode default = 0x01;
8199+
ram attribute temperatureSetpointHold default = 0;
8200+
ram attribute temperatureSetpointHoldDuration;
81998201
callback attribute presetTypes;
82008202
callback attribute scheduleTypes;
82018203
ram attribute numberOfPresets default = 0;

examples/all-clusters-app/all-clusters-common/all-clusters-app.zap

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13437,6 +13437,38 @@
1343713437
"maxInterval": 65344,
1343813438
"reportableChange": 0
1343913439
},
13440+
{
13441+
"name": "TemperatureSetpointHold",
13442+
"code": 35,
13443+
"mfgCode": null,
13444+
"side": "server",
13445+
"type": "TemperatureSetpointHoldEnum",
13446+
"included": 1,
13447+
"storageOption": "RAM",
13448+
"singleton": 0,
13449+
"bounded": 0,
13450+
"defaultValue": "0",
13451+
"reportable": 1,
13452+
"minInterval": 1,
13453+
"maxInterval": 65534,
13454+
"reportableChange": 0
13455+
},
13456+
{
13457+
"name": "TemperatureSetpointHoldDuration",
13458+
"code": 36,
13459+
"mfgCode": null,
13460+
"side": "server",
13461+
"type": "int16u",
13462+
"included": 1,
13463+
"storageOption": "RAM",
13464+
"singleton": 0,
13465+
"bounded": 0,
13466+
"defaultValue": null,
13467+
"reportable": 1,
13468+
"minInterval": 1,
13469+
"maxInterval": 65534,
13470+
"reportableChange": 0
13471+
},
1344013472
{
1344113473
"name": "PresetTypes",
1344213474
"code": 72,

examples/thermostat/thermostat-common/thermostat.matter

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,6 +1801,153 @@ cluster EthernetNetworkDiagnostics = 55 {
18011801
command access(invoke: manage) ResetCounts(): DefaultSuccess = 0;
18021802
}
18031803

1804+
/** Accurate time is required for a number of reasons, including scheduling, display and validating security materials. */
1805+
cluster TimeSynchronization = 56 {
1806+
revision 2;
1807+
1808+
enum GranularityEnum : enum8 {
1809+
kNoTimeGranularity = 0;
1810+
kMinutesGranularity = 1;
1811+
kSecondsGranularity = 2;
1812+
kMillisecondsGranularity = 3;
1813+
kMicrosecondsGranularity = 4;
1814+
}
1815+
1816+
enum StatusCode : enum8 {
1817+
kTimeNotAccepted = 2;
1818+
}
1819+
1820+
enum TimeSourceEnum : enum8 {
1821+
kNone = 0;
1822+
kUnknown = 1;
1823+
kAdmin = 2;
1824+
kNodeTimeCluster = 3;
1825+
kNonMatterSNTP = 4;
1826+
kNonMatterNTP = 5;
1827+
kMatterSNTP = 6;
1828+
kMatterNTP = 7;
1829+
kMixedNTP = 8;
1830+
kNonMatterSNTPNTS = 9;
1831+
kNonMatterNTPNTS = 10;
1832+
kMatterSNTPNTS = 11;
1833+
kMatterNTPNTS = 12;
1834+
kMixedNTPNTS = 13;
1835+
kCloudSource = 14;
1836+
kPTP = 15 [spec_name = "PTP"];
1837+
kGNSS = 16 [spec_name = "GNSS"];
1838+
}
1839+
1840+
enum TimeZoneDatabaseEnum : enum8 {
1841+
kFull = 0;
1842+
kPartial = 1;
1843+
kNone = 2;
1844+
}
1845+
1846+
bitmap Feature : bitmap32 {
1847+
kTimeZone = 0x1;
1848+
kNTPClient = 0x2;
1849+
kNTPServer = 0x4;
1850+
kTimeSyncClient = 0x8;
1851+
}
1852+
1853+
struct DSTOffsetStruct {
1854+
int32s offset = 0;
1855+
epoch_us validStarting = 1;
1856+
nullable epoch_us validUntil = 2;
1857+
}
1858+
1859+
struct FabricScopedTrustedTimeSourceStruct {
1860+
node_id nodeID = 0;
1861+
endpoint_no endpoint = 1;
1862+
}
1863+
1864+
struct TimeZoneStruct {
1865+
int32s offset = 0;
1866+
epoch_us validAt = 1;
1867+
optional char_string<64> name = 2;
1868+
}
1869+
1870+
struct TrustedTimeSourceStruct {
1871+
fabric_idx fabricIndex = 0;
1872+
node_id nodeID = 1;
1873+
endpoint_no endpoint = 2;
1874+
}
1875+
1876+
info event DSTTableEmpty = 0 {
1877+
}
1878+
1879+
info event DSTStatus = 1 {
1880+
boolean DSTOffsetActive = 0;
1881+
}
1882+
1883+
info event TimeZoneStatus = 2 {
1884+
int32s offset = 0;
1885+
optional char_string name = 1;
1886+
}
1887+
1888+
info event TimeFailure = 3 {
1889+
}
1890+
1891+
info event MissingTrustedTimeSource = 4 {
1892+
}
1893+
1894+
readonly attribute nullable epoch_us UTCTime = 0;
1895+
readonly attribute GranularityEnum granularity = 1;
1896+
readonly attribute optional TimeSourceEnum timeSource = 2;
1897+
readonly attribute optional nullable TrustedTimeSourceStruct trustedTimeSource = 3;
1898+
readonly attribute optional nullable char_string<128> defaultNTP = 4;
1899+
readonly attribute optional TimeZoneStruct timeZone[] = 5;
1900+
readonly attribute optional DSTOffsetStruct DSTOffset[] = 6;
1901+
readonly attribute optional nullable epoch_us localTime = 7;
1902+
readonly attribute optional TimeZoneDatabaseEnum timeZoneDatabase = 8;
1903+
readonly attribute optional boolean NTPServerAvailable = 9;
1904+
readonly attribute optional int8u timeZoneListMaxSize = 10;
1905+
readonly attribute optional int8u DSTOffsetListMaxSize = 11;
1906+
readonly attribute optional boolean supportsDNSResolve = 12;
1907+
readonly attribute command_id generatedCommandList[] = 65528;
1908+
readonly attribute command_id acceptedCommandList[] = 65529;
1909+
readonly attribute attrib_id attributeList[] = 65531;
1910+
readonly attribute bitmap32 featureMap = 65532;
1911+
readonly attribute int16u clusterRevision = 65533;
1912+
1913+
request struct SetUTCTimeRequest {
1914+
epoch_us UTCTime = 0;
1915+
GranularityEnum granularity = 1;
1916+
optional TimeSourceEnum timeSource = 2;
1917+
}
1918+
1919+
request struct SetTrustedTimeSourceRequest {
1920+
nullable FabricScopedTrustedTimeSourceStruct trustedTimeSource = 0;
1921+
}
1922+
1923+
request struct SetTimeZoneRequest {
1924+
TimeZoneStruct timeZone[] = 0;
1925+
}
1926+
1927+
response struct SetTimeZoneResponse = 3 {
1928+
boolean DSTOffsetRequired = 0;
1929+
}
1930+
1931+
request struct SetDSTOffsetRequest {
1932+
DSTOffsetStruct DSTOffset[] = 0;
1933+
}
1934+
1935+
request struct SetDefaultNTPRequest {
1936+
nullable char_string<128> defaultNTP = 0;
1937+
}
1938+
1939+
/** This command is used to set the UTC time of the node. */
1940+
command access(invoke: administer) SetUTCTime(SetUTCTimeRequest): DefaultSuccess = 0;
1941+
/** This command is used to set the TrustedTimeSource attribute. */
1942+
fabric command access(invoke: administer) SetTrustedTimeSource(SetTrustedTimeSourceRequest): DefaultSuccess = 1;
1943+
/** This command is used to set the time zone of the node. */
1944+
command access(invoke: manage) SetTimeZone(SetTimeZoneRequest): SetTimeZoneResponse = 2;
1945+
/** This command is used to set the DST offsets for a node. */
1946+
command access(invoke: manage) SetDSTOffset(SetDSTOffsetRequest): DefaultSuccess = 4;
1947+
/** This command is used to set the DefaultNTP attribute. */
1948+
command access(invoke: administer) SetDefaultNTP(SetDefaultNTPRequest): DefaultSuccess = 5;
1949+
}
1950+
18041951
/** Commands to trigger a Node to allow a new Administrator to commission it. */
18051952
cluster AdministratorCommissioning = 60 {
18061953
revision 1;
@@ -2858,6 +3005,18 @@ endpoint 0 {
28583005
handle command ResetCounts;
28593006
}
28603007

3008+
server cluster TimeSynchronization {
3009+
callback attribute UTCTime;
3010+
callback attribute granularity;
3011+
callback attribute generatedCommandList;
3012+
callback attribute acceptedCommandList;
3013+
callback attribute attributeList;
3014+
ram attribute featureMap default = 0;
3015+
callback attribute clusterRevision;
3016+
3017+
handle command SetUTCTime;
3018+
}
3019+
28613020
server cluster AdministratorCommissioning {
28623021
callback attribute windowStatus;
28633022
callback attribute adminFabricIndex;
@@ -2974,6 +3133,8 @@ endpoint 1 {
29743133
ram attribute minSetpointDeadBand default = 0x19;
29753134
ram attribute controlSequenceOfOperation default = 0x04;
29763135
persist attribute systemMode default = 0x01;
3136+
ram attribute temperatureSetpointHold default = 0;
3137+
ram attribute temperatureSetpointHoldDuration;
29773138
callback attribute presetTypes;
29783139
callback attribute scheduleTypes;
29793140
ram attribute numberOfPresets default = 0;

0 commit comments

Comments
 (0)