diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter index 595479d4f0cd07..9664bbab2be9cf 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter @@ -1561,7 +1561,7 @@ cluster ActivatedCarbonFilterMonitoring = 114 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 7; + revision 9; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1679,6 +1679,7 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; + kEvents = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1787,6 +1788,47 @@ cluster Thermostat = 513 { nullable temperature coolSetpoint = 2; } + info event SystemModeChange = 0 { + optional SystemModeEnum previousSystemMode = 0; + SystemModeEnum currentSystemMode = 1; + } + + info event LocalTemperatureChange = 1 { + nullable temperature currentLocalTemperature = 0; + } + + info event OccupancyChange = 2 { + optional OccupancyBitmap previousOccupancy = 0; + OccupancyBitmap currentOccupancy = 1; + } + + info event SetpointChange = 3 { + SystemModeEnum systemMode = 0; + optional OccupancyBitmap occupancy = 1; + optional temperature previousSetpoint = 2; + temperature currentSetpoint = 3; + } + + info event RunningStateChange = 4 { + optional RelayStateBitmap previousRunningState = 0; + RelayStateBitmap currentRunningState = 1; + } + + info event RunningModeChange = 5 { + optional ThermostatRunningModeEnum previousRunningMode = 0; + ThermostatRunningModeEnum currentRunningMode = 1; + } + + info event ActiveScheduleChange = 6 { + optional nullable octet_string previousScheduleHandle = 0; + nullable octet_string currentScheduleHandle = 1; + } + + info event ActivePresetChange = 7 { + optional nullable octet_string previousPresetHandle = 0; + nullable octet_string currentPresetHandle = 1; + } + readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; readonly attribute optional OccupancyBitmap occupancy = 2; diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index fba8045abba478..4e27e48cbbf0af 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -5424,7 +5424,7 @@ cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 7; + revision 9; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -5542,6 +5542,7 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; + kEvents = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -5650,6 +5651,47 @@ cluster Thermostat = 513 { nullable temperature coolSetpoint = 2; } + info event SystemModeChange = 0 { + optional SystemModeEnum previousSystemMode = 0; + SystemModeEnum currentSystemMode = 1; + } + + info event LocalTemperatureChange = 1 { + nullable temperature currentLocalTemperature = 0; + } + + info event OccupancyChange = 2 { + optional OccupancyBitmap previousOccupancy = 0; + OccupancyBitmap currentOccupancy = 1; + } + + info event SetpointChange = 3 { + SystemModeEnum systemMode = 0; + optional OccupancyBitmap occupancy = 1; + optional temperature previousSetpoint = 2; + temperature currentSetpoint = 3; + } + + info event RunningStateChange = 4 { + optional RelayStateBitmap previousRunningState = 0; + RelayStateBitmap currentRunningState = 1; + } + + info event RunningModeChange = 5 { + optional ThermostatRunningModeEnum previousRunningMode = 0; + ThermostatRunningModeEnum currentRunningMode = 1; + } + + info event ActiveScheduleChange = 6 { + optional nullable octet_string previousScheduleHandle = 0; + nullable octet_string currentScheduleHandle = 1; + } + + info event ActivePresetChange = 7 { + optional nullable octet_string previousPresetHandle = 0; + nullable octet_string currentPresetHandle = 1; + } + readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; readonly attribute optional OccupancyBitmap occupancy = 2; diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 1ad6b719f2e140..ee1633e8b4dd9f 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -3836,7 +3836,7 @@ cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 7; + revision 9; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -3954,6 +3954,7 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; + kEvents = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -4062,6 +4063,47 @@ cluster Thermostat = 513 { nullable temperature coolSetpoint = 2; } + info event SystemModeChange = 0 { + optional SystemModeEnum previousSystemMode = 0; + SystemModeEnum currentSystemMode = 1; + } + + info event LocalTemperatureChange = 1 { + nullable temperature currentLocalTemperature = 0; + } + + info event OccupancyChange = 2 { + optional OccupancyBitmap previousOccupancy = 0; + OccupancyBitmap currentOccupancy = 1; + } + + info event SetpointChange = 3 { + SystemModeEnum systemMode = 0; + optional OccupancyBitmap occupancy = 1; + optional temperature previousSetpoint = 2; + temperature currentSetpoint = 3; + } + + info event RunningStateChange = 4 { + optional RelayStateBitmap previousRunningState = 0; + RelayStateBitmap currentRunningState = 1; + } + + info event RunningModeChange = 5 { + optional ThermostatRunningModeEnum previousRunningMode = 0; + ThermostatRunningModeEnum currentRunningMode = 1; + } + + info event ActiveScheduleChange = 6 { + optional nullable octet_string previousScheduleHandle = 0; + nullable octet_string currentScheduleHandle = 1; + } + + info event ActivePresetChange = 7 { + optional nullable octet_string previousPresetHandle = 0; + nullable octet_string currentPresetHandle = 1; + } + readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; readonly attribute optional OccupancyBitmap occupancy = 2; diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter index 42938c10e5d604..c2be4f3becfab7 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter @@ -1484,7 +1484,7 @@ cluster ActivatedCarbonFilterMonitoring = 114 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 7; + revision 9; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1602,6 +1602,7 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; + kEvents = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1710,6 +1711,47 @@ cluster Thermostat = 513 { nullable temperature coolSetpoint = 2; } + info event SystemModeChange = 0 { + optional SystemModeEnum previousSystemMode = 0; + SystemModeEnum currentSystemMode = 1; + } + + info event LocalTemperatureChange = 1 { + nullable temperature currentLocalTemperature = 0; + } + + info event OccupancyChange = 2 { + optional OccupancyBitmap previousOccupancy = 0; + OccupancyBitmap currentOccupancy = 1; + } + + info event SetpointChange = 3 { + SystemModeEnum systemMode = 0; + optional OccupancyBitmap occupancy = 1; + optional temperature previousSetpoint = 2; + temperature currentSetpoint = 3; + } + + info event RunningStateChange = 4 { + optional RelayStateBitmap previousRunningState = 0; + RelayStateBitmap currentRunningState = 1; + } + + info event RunningModeChange = 5 { + optional ThermostatRunningModeEnum previousRunningMode = 0; + ThermostatRunningModeEnum currentRunningMode = 1; + } + + info event ActiveScheduleChange = 6 { + optional nullable octet_string previousScheduleHandle = 0; + nullable octet_string currentScheduleHandle = 1; + } + + info event ActivePresetChange = 7 { + optional nullable octet_string previousPresetHandle = 0; + nullable octet_string currentPresetHandle = 1; + } + readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; readonly attribute optional OccupancyBitmap occupancy = 2; diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 9663c2dbaac876..2e2d2788fe2596 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -1780,7 +1780,7 @@ cluster FixedLabel = 64 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 7; + revision 9; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1898,6 +1898,7 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; + kEvents = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -2006,6 +2007,47 @@ cluster Thermostat = 513 { nullable temperature coolSetpoint = 2; } + info event SystemModeChange = 0 { + optional SystemModeEnum previousSystemMode = 0; + SystemModeEnum currentSystemMode = 1; + } + + info event LocalTemperatureChange = 1 { + nullable temperature currentLocalTemperature = 0; + } + + info event OccupancyChange = 2 { + optional OccupancyBitmap previousOccupancy = 0; + OccupancyBitmap currentOccupancy = 1; + } + + info event SetpointChange = 3 { + SystemModeEnum systemMode = 0; + optional OccupancyBitmap occupancy = 1; + optional temperature previousSetpoint = 2; + temperature currentSetpoint = 3; + } + + info event RunningStateChange = 4 { + optional RelayStateBitmap previousRunningState = 0; + RelayStateBitmap currentRunningState = 1; + } + + info event RunningModeChange = 5 { + optional ThermostatRunningModeEnum previousRunningMode = 0; + ThermostatRunningModeEnum currentRunningMode = 1; + } + + info event ActiveScheduleChange = 6 { + optional nullable octet_string previousScheduleHandle = 0; + nullable octet_string currentScheduleHandle = 1; + } + + info event ActivePresetChange = 7 { + optional nullable octet_string previousPresetHandle = 0; + nullable octet_string currentPresetHandle = 1; + } + readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; readonly attribute optional OccupancyBitmap occupancy = 2; diff --git a/examples/chef/devices/rootnode_heatpump_87ivjRAECh.matter b/examples/chef/devices/rootnode_heatpump_87ivjRAECh.matter index 0f1a502da0c5e7..24e0567c472d71 100644 --- a/examples/chef/devices/rootnode_heatpump_87ivjRAECh.matter +++ b/examples/chef/devices/rootnode_heatpump_87ivjRAECh.matter @@ -2043,7 +2043,7 @@ provisional cluster DeviceEnergyManagementMode = 159 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 7; + revision 9; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -2161,6 +2161,7 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; + kEvents = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -2269,6 +2270,47 @@ cluster Thermostat = 513 { nullable temperature coolSetpoint = 2; } + info event SystemModeChange = 0 { + optional SystemModeEnum previousSystemMode = 0; + SystemModeEnum currentSystemMode = 1; + } + + info event LocalTemperatureChange = 1 { + nullable temperature currentLocalTemperature = 0; + } + + info event OccupancyChange = 2 { + optional OccupancyBitmap previousOccupancy = 0; + OccupancyBitmap currentOccupancy = 1; + } + + info event SetpointChange = 3 { + SystemModeEnum systemMode = 0; + optional OccupancyBitmap occupancy = 1; + optional temperature previousSetpoint = 2; + temperature currentSetpoint = 3; + } + + info event RunningStateChange = 4 { + optional RelayStateBitmap previousRunningState = 0; + RelayStateBitmap currentRunningState = 1; + } + + info event RunningModeChange = 5 { + optional ThermostatRunningModeEnum previousRunningMode = 0; + ThermostatRunningModeEnum currentRunningMode = 1; + } + + info event ActiveScheduleChange = 6 { + optional nullable octet_string previousScheduleHandle = 0; + nullable octet_string currentScheduleHandle = 1; + } + + info event ActivePresetChange = 7 { + optional nullable octet_string previousPresetHandle = 0; + nullable octet_string currentPresetHandle = 1; + } + readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; readonly attribute optional OccupancyBitmap occupancy = 2; diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter index 4d551647243a32..1ec99978acc765 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter @@ -1424,7 +1424,7 @@ cluster GroupKeyManagement = 63 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 7; + revision 9; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1542,6 +1542,7 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; + kEvents = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1650,6 +1651,47 @@ cluster Thermostat = 513 { nullable temperature coolSetpoint = 2; } + info event SystemModeChange = 0 { + optional SystemModeEnum previousSystemMode = 0; + SystemModeEnum currentSystemMode = 1; + } + + info event LocalTemperatureChange = 1 { + nullable temperature currentLocalTemperature = 0; + } + + info event OccupancyChange = 2 { + optional OccupancyBitmap previousOccupancy = 0; + OccupancyBitmap currentOccupancy = 1; + } + + info event SetpointChange = 3 { + SystemModeEnum systemMode = 0; + optional OccupancyBitmap occupancy = 1; + optional temperature previousSetpoint = 2; + temperature currentSetpoint = 3; + } + + info event RunningStateChange = 4 { + optional RelayStateBitmap previousRunningState = 0; + RelayStateBitmap currentRunningState = 1; + } + + info event RunningModeChange = 5 { + optional ThermostatRunningModeEnum previousRunningMode = 0; + ThermostatRunningModeEnum currentRunningMode = 1; + } + + info event ActiveScheduleChange = 6 { + optional nullable octet_string previousScheduleHandle = 0; + nullable octet_string currentScheduleHandle = 1; + } + + info event ActivePresetChange = 7 { + optional nullable octet_string previousPresetHandle = 0; + nullable octet_string currentPresetHandle = 1; + } + readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; readonly attribute optional OccupancyBitmap occupancy = 2; diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 9190f45a888283..de2f0e77869624 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -1644,7 +1644,7 @@ cluster FixedLabel = 64 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 7; + revision 9; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1762,6 +1762,7 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; + kEvents = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1870,6 +1871,47 @@ cluster Thermostat = 513 { nullable temperature coolSetpoint = 2; } + info event SystemModeChange = 0 { + optional SystemModeEnum previousSystemMode = 0; + SystemModeEnum currentSystemMode = 1; + } + + info event LocalTemperatureChange = 1 { + nullable temperature currentLocalTemperature = 0; + } + + info event OccupancyChange = 2 { + optional OccupancyBitmap previousOccupancy = 0; + OccupancyBitmap currentOccupancy = 1; + } + + info event SetpointChange = 3 { + SystemModeEnum systemMode = 0; + optional OccupancyBitmap occupancy = 1; + optional temperature previousSetpoint = 2; + temperature currentSetpoint = 3; + } + + info event RunningStateChange = 4 { + optional RelayStateBitmap previousRunningState = 0; + RelayStateBitmap currentRunningState = 1; + } + + info event RunningModeChange = 5 { + optional ThermostatRunningModeEnum previousRunningMode = 0; + ThermostatRunningModeEnum currentRunningMode = 1; + } + + info event ActiveScheduleChange = 6 { + optional nullable octet_string previousScheduleHandle = 0; + nullable octet_string currentScheduleHandle = 1; + } + + info event ActivePresetChange = 7 { + optional nullable octet_string previousPresetHandle = 0; + nullable octet_string currentPresetHandle = 1; + } + readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; readonly attribute optional OccupancyBitmap occupancy = 2; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 5925f477fa182e..998f8b8bf9468c 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -5146,7 +5146,7 @@ cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 7; + revision 9; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -5264,6 +5264,7 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; + kEvents = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -5372,6 +5373,47 @@ cluster Thermostat = 513 { nullable temperature coolSetpoint = 2; } + info event SystemModeChange = 0 { + optional SystemModeEnum previousSystemMode = 0; + SystemModeEnum currentSystemMode = 1; + } + + info event LocalTemperatureChange = 1 { + nullable temperature currentLocalTemperature = 0; + } + + info event OccupancyChange = 2 { + optional OccupancyBitmap previousOccupancy = 0; + OccupancyBitmap currentOccupancy = 1; + } + + info event SetpointChange = 3 { + SystemModeEnum systemMode = 0; + optional OccupancyBitmap occupancy = 1; + optional temperature previousSetpoint = 2; + temperature currentSetpoint = 3; + } + + info event RunningStateChange = 4 { + optional RelayStateBitmap previousRunningState = 0; + RelayStateBitmap currentRunningState = 1; + } + + info event RunningModeChange = 5 { + optional ThermostatRunningModeEnum previousRunningMode = 0; + ThermostatRunningModeEnum currentRunningMode = 1; + } + + info event ActiveScheduleChange = 6 { + optional nullable octet_string previousScheduleHandle = 0; + nullable octet_string currentScheduleHandle = 1; + } + + info event ActivePresetChange = 7 { + optional nullable octet_string previousPresetHandle = 0; + nullable octet_string currentPresetHandle = 1; + } + readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; readonly attribute optional OccupancyBitmap occupancy = 2; @@ -5501,7 +5543,7 @@ cluster Thermostat = 513 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 7; + revision 9; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -5619,6 +5661,7 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; + kEvents = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -5727,6 +5770,47 @@ cluster Thermostat = 513 { nullable temperature coolSetpoint = 2; } + info event SystemModeChange = 0 { + optional SystemModeEnum previousSystemMode = 0; + SystemModeEnum currentSystemMode = 1; + } + + info event LocalTemperatureChange = 1 { + nullable temperature currentLocalTemperature = 0; + } + + info event OccupancyChange = 2 { + optional OccupancyBitmap previousOccupancy = 0; + OccupancyBitmap currentOccupancy = 1; + } + + info event SetpointChange = 3 { + SystemModeEnum systemMode = 0; + optional OccupancyBitmap occupancy = 1; + optional temperature previousSetpoint = 2; + temperature currentSetpoint = 3; + } + + info event RunningStateChange = 4 { + optional RelayStateBitmap previousRunningState = 0; + RelayStateBitmap currentRunningState = 1; + } + + info event RunningModeChange = 5 { + optional ThermostatRunningModeEnum previousRunningMode = 0; + ThermostatRunningModeEnum currentRunningMode = 1; + } + + info event ActiveScheduleChange = 6 { + optional nullable octet_string previousScheduleHandle = 0; + nullable octet_string currentScheduleHandle = 1; + } + + info event ActivePresetChange = 7 { + optional nullable octet_string previousPresetHandle = 0; + nullable octet_string currentPresetHandle = 1; + } + readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; readonly attribute optional OccupancyBitmap occupancy = 2; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index d06ccd4d1dfe94..7e4d51621c6997 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -5103,7 +5103,7 @@ cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 7; + revision 9; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -5221,6 +5221,7 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; + kEvents = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -5329,6 +5330,47 @@ cluster Thermostat = 513 { nullable temperature coolSetpoint = 2; } + info event SystemModeChange = 0 { + optional SystemModeEnum previousSystemMode = 0; + SystemModeEnum currentSystemMode = 1; + } + + info event LocalTemperatureChange = 1 { + nullable temperature currentLocalTemperature = 0; + } + + info event OccupancyChange = 2 { + optional OccupancyBitmap previousOccupancy = 0; + OccupancyBitmap currentOccupancy = 1; + } + + info event SetpointChange = 3 { + SystemModeEnum systemMode = 0; + optional OccupancyBitmap occupancy = 1; + optional temperature previousSetpoint = 2; + temperature currentSetpoint = 3; + } + + info event RunningStateChange = 4 { + optional RelayStateBitmap previousRunningState = 0; + RelayStateBitmap currentRunningState = 1; + } + + info event RunningModeChange = 5 { + optional ThermostatRunningModeEnum previousRunningMode = 0; + ThermostatRunningModeEnum currentRunningMode = 1; + } + + info event ActiveScheduleChange = 6 { + optional nullable octet_string previousScheduleHandle = 0; + nullable octet_string currentScheduleHandle = 1; + } + + info event ActivePresetChange = 7 { + optional nullable octet_string previousPresetHandle = 0; + nullable octet_string currentPresetHandle = 1; + } + readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; readonly attribute optional OccupancyBitmap occupancy = 2; @@ -5458,7 +5500,7 @@ cluster Thermostat = 513 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 7; + revision 9; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -5576,6 +5618,7 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; + kEvents = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -5684,6 +5727,47 @@ cluster Thermostat = 513 { nullable temperature coolSetpoint = 2; } + info event SystemModeChange = 0 { + optional SystemModeEnum previousSystemMode = 0; + SystemModeEnum currentSystemMode = 1; + } + + info event LocalTemperatureChange = 1 { + nullable temperature currentLocalTemperature = 0; + } + + info event OccupancyChange = 2 { + optional OccupancyBitmap previousOccupancy = 0; + OccupancyBitmap currentOccupancy = 1; + } + + info event SetpointChange = 3 { + SystemModeEnum systemMode = 0; + optional OccupancyBitmap occupancy = 1; + optional temperature previousSetpoint = 2; + temperature currentSetpoint = 3; + } + + info event RunningStateChange = 4 { + optional RelayStateBitmap previousRunningState = 0; + RelayStateBitmap currentRunningState = 1; + } + + info event RunningModeChange = 5 { + optional ThermostatRunningModeEnum previousRunningMode = 0; + ThermostatRunningModeEnum currentRunningMode = 1; + } + + info event ActiveScheduleChange = 6 { + optional nullable octet_string previousScheduleHandle = 0; + nullable octet_string currentScheduleHandle = 1; + } + + info event ActivePresetChange = 7 { + optional nullable octet_string previousPresetHandle = 0; + nullable octet_string currentPresetHandle = 1; + } + readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; readonly attribute optional OccupancyBitmap occupancy = 2; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_br.matter b/examples/thermostat/nxp/zap/thermostat_matter_br.matter index ba5f578b175c32..cec9dcd362fe5e 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_br.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_br.matter @@ -1746,7 +1746,7 @@ cluster UserLabel = 65 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 7; + revision 9; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1864,6 +1864,7 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; + kEvents = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1972,6 +1973,47 @@ cluster Thermostat = 513 { nullable temperature coolSetpoint = 2; } + info event SystemModeChange = 0 { + optional SystemModeEnum previousSystemMode = 0; + SystemModeEnum currentSystemMode = 1; + } + + info event LocalTemperatureChange = 1 { + nullable temperature currentLocalTemperature = 0; + } + + info event OccupancyChange = 2 { + optional OccupancyBitmap previousOccupancy = 0; + OccupancyBitmap currentOccupancy = 1; + } + + info event SetpointChange = 3 { + SystemModeEnum systemMode = 0; + optional OccupancyBitmap occupancy = 1; + optional temperature previousSetpoint = 2; + temperature currentSetpoint = 3; + } + + info event RunningStateChange = 4 { + optional RelayStateBitmap previousRunningState = 0; + RelayStateBitmap currentRunningState = 1; + } + + info event RunningModeChange = 5 { + optional ThermostatRunningModeEnum previousRunningMode = 0; + ThermostatRunningModeEnum currentRunningMode = 1; + } + + info event ActiveScheduleChange = 6 { + optional nullable octet_string previousScheduleHandle = 0; + nullable octet_string currentScheduleHandle = 1; + } + + info event ActivePresetChange = 7 { + optional nullable octet_string previousPresetHandle = 0; + nullable octet_string currentPresetHandle = 1; + } + readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; readonly attribute optional OccupancyBitmap occupancy = 2; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index 082a05a80905c5..091b8f348ef69d 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -1669,7 +1669,7 @@ cluster UserLabel = 65 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 7; + revision 9; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1787,6 +1787,7 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; + kEvents = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1895,6 +1896,47 @@ cluster Thermostat = 513 { nullable temperature coolSetpoint = 2; } + info event SystemModeChange = 0 { + optional SystemModeEnum previousSystemMode = 0; + SystemModeEnum currentSystemMode = 1; + } + + info event LocalTemperatureChange = 1 { + nullable temperature currentLocalTemperature = 0; + } + + info event OccupancyChange = 2 { + optional OccupancyBitmap previousOccupancy = 0; + OccupancyBitmap currentOccupancy = 1; + } + + info event SetpointChange = 3 { + SystemModeEnum systemMode = 0; + optional OccupancyBitmap occupancy = 1; + optional temperature previousSetpoint = 2; + temperature currentSetpoint = 3; + } + + info event RunningStateChange = 4 { + optional RelayStateBitmap previousRunningState = 0; + RelayStateBitmap currentRunningState = 1; + } + + info event RunningModeChange = 5 { + optional ThermostatRunningModeEnum previousRunningMode = 0; + ThermostatRunningModeEnum currentRunningMode = 1; + } + + info event ActiveScheduleChange = 6 { + optional nullable octet_string previousScheduleHandle = 0; + nullable octet_string currentScheduleHandle = 1; + } + + info event ActivePresetChange = 7 { + optional nullable octet_string previousPresetHandle = 0; + nullable octet_string currentPresetHandle = 1; + } + readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; readonly attribute optional OccupancyBitmap occupancy = 2; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index 219be740e185b3..c0f50157196883 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -1580,7 +1580,7 @@ cluster UserLabel = 65 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 7; + revision 9; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1698,6 +1698,7 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; + kEvents = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1806,6 +1807,47 @@ cluster Thermostat = 513 { nullable temperature coolSetpoint = 2; } + info event SystemModeChange = 0 { + optional SystemModeEnum previousSystemMode = 0; + SystemModeEnum currentSystemMode = 1; + } + + info event LocalTemperatureChange = 1 { + nullable temperature currentLocalTemperature = 0; + } + + info event OccupancyChange = 2 { + optional OccupancyBitmap previousOccupancy = 0; + OccupancyBitmap currentOccupancy = 1; + } + + info event SetpointChange = 3 { + SystemModeEnum systemMode = 0; + optional OccupancyBitmap occupancy = 1; + optional temperature previousSetpoint = 2; + temperature currentSetpoint = 3; + } + + info event RunningStateChange = 4 { + optional RelayStateBitmap previousRunningState = 0; + RelayStateBitmap currentRunningState = 1; + } + + info event RunningModeChange = 5 { + optional ThermostatRunningModeEnum previousRunningMode = 0; + ThermostatRunningModeEnum currentRunningMode = 1; + } + + info event ActiveScheduleChange = 6 { + optional nullable octet_string previousScheduleHandle = 0; + nullable octet_string currentScheduleHandle = 1; + } + + info event ActivePresetChange = 7 { + optional nullable octet_string previousPresetHandle = 0; + nullable octet_string currentPresetHandle = 1; + } + readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; readonly attribute optional OccupancyBitmap occupancy = 2; diff --git a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter index 0815e0ea559f55..0b84ef539daddc 100644 --- a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter +++ b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter @@ -1843,7 +1843,7 @@ cluster UserLabel = 65 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 7; + revision 9; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1961,6 +1961,7 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; + kEvents = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -2069,6 +2070,47 @@ cluster Thermostat = 513 { nullable temperature coolSetpoint = 2; } + info event SystemModeChange = 0 { + optional SystemModeEnum previousSystemMode = 0; + SystemModeEnum currentSystemMode = 1; + } + + info event LocalTemperatureChange = 1 { + nullable temperature currentLocalTemperature = 0; + } + + info event OccupancyChange = 2 { + optional OccupancyBitmap previousOccupancy = 0; + OccupancyBitmap currentOccupancy = 1; + } + + info event SetpointChange = 3 { + SystemModeEnum systemMode = 0; + optional OccupancyBitmap occupancy = 1; + optional temperature previousSetpoint = 2; + temperature currentSetpoint = 3; + } + + info event RunningStateChange = 4 { + optional RelayStateBitmap previousRunningState = 0; + RelayStateBitmap currentRunningState = 1; + } + + info event RunningModeChange = 5 { + optional ThermostatRunningModeEnum previousRunningMode = 0; + ThermostatRunningModeEnum currentRunningMode = 1; + } + + info event ActiveScheduleChange = 6 { + optional nullable octet_string previousScheduleHandle = 0; + nullable octet_string currentScheduleHandle = 1; + } + + info event ActivePresetChange = 7 { + optional nullable octet_string previousPresetHandle = 0; + nullable octet_string currentPresetHandle = 1; + } + readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; readonly attribute optional OccupancyBitmap occupancy = 2; diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 68cc219b8a2244..312d4e2f05d70e 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -2023,7 +2023,7 @@ cluster UserLabel = 65 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 7; + revision 9; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -2141,6 +2141,7 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; + kEvents = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -2249,6 +2250,47 @@ cluster Thermostat = 513 { nullable temperature coolSetpoint = 2; } + info event SystemModeChange = 0 { + optional SystemModeEnum previousSystemMode = 0; + SystemModeEnum currentSystemMode = 1; + } + + info event LocalTemperatureChange = 1 { + nullable temperature currentLocalTemperature = 0; + } + + info event OccupancyChange = 2 { + optional OccupancyBitmap previousOccupancy = 0; + OccupancyBitmap currentOccupancy = 1; + } + + info event SetpointChange = 3 { + SystemModeEnum systemMode = 0; + optional OccupancyBitmap occupancy = 1; + optional temperature previousSetpoint = 2; + temperature currentSetpoint = 3; + } + + info event RunningStateChange = 4 { + optional RelayStateBitmap previousRunningState = 0; + RelayStateBitmap currentRunningState = 1; + } + + info event RunningModeChange = 5 { + optional ThermostatRunningModeEnum previousRunningMode = 0; + ThermostatRunningModeEnum currentRunningMode = 1; + } + + info event ActiveScheduleChange = 6 { + optional nullable octet_string previousScheduleHandle = 0; + nullable octet_string currentScheduleHandle = 1; + } + + info event ActivePresetChange = 7 { + optional nullable octet_string previousPresetHandle = 0; + nullable octet_string currentPresetHandle = 1; + } + readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; readonly attribute optional OccupancyBitmap occupancy = 2; diff --git a/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml index e2109af8dda365..b81b8271bf8b20 100644 --- a/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml @@ -1,6 +1,6 @@ @@ -675,17 +678,107 @@ limitations under the License. Returns the status of an atomic write - - + + Begins, Commits or Cancels an atomic write - - + + + + This event SHALL be generated when the SystemMode attribute changes. + + + + + + + + + This event SHALL be generated when the LocalTemperature attribute changes significantly. + + + + + + + + + + + + + This event SHALL be generated when the Occupancy attribute changes. + + + + + + + + + + + + This event SHALL be generated when the value of any of the OccupiedHeatingSetpoint, UnoccupiedHeatingSetpoint, OccupiedCoolingSetpoint, or UnoccupiedCoolingSetpoint attributes is changed. + + + + + + + + + + + This event SHALL be generated when the ThermostatRunningState attribute changes. + + + + + + + + + This event SHALL be generated when the ThermostatRunningMode attribute changes. + + + + + + + + + + + + This event SHALL be generated when the ActiveScheduleHandle attribute changes. + + + + + + + + + + + + This event SHALL be generated when the ActivePresetHandle attribute changes. + + + + + + + + + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 47cf84408efd39..a45d5c74e462d6 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -6864,7 +6864,7 @@ cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 7; + revision 9; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -6982,6 +6982,7 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; + kEvents = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -7090,6 +7091,47 @@ cluster Thermostat = 513 { nullable temperature coolSetpoint = 2; } + info event SystemModeChange = 0 { + optional SystemModeEnum previousSystemMode = 0; + SystemModeEnum currentSystemMode = 1; + } + + info event LocalTemperatureChange = 1 { + nullable temperature currentLocalTemperature = 0; + } + + info event OccupancyChange = 2 { + optional OccupancyBitmap previousOccupancy = 0; + OccupancyBitmap currentOccupancy = 1; + } + + info event SetpointChange = 3 { + SystemModeEnum systemMode = 0; + optional OccupancyBitmap occupancy = 1; + optional temperature previousSetpoint = 2; + temperature currentSetpoint = 3; + } + + info event RunningStateChange = 4 { + optional RelayStateBitmap previousRunningState = 0; + RelayStateBitmap currentRunningState = 1; + } + + info event RunningModeChange = 5 { + optional ThermostatRunningModeEnum previousRunningMode = 0; + ThermostatRunningModeEnum currentRunningMode = 1; + } + + info event ActiveScheduleChange = 6 { + optional nullable octet_string previousScheduleHandle = 0; + nullable octet_string currentScheduleHandle = 1; + } + + info event ActivePresetChange = 7 { + optional nullable octet_string previousPresetHandle = 0; + nullable octet_string currentPresetHandle = 1; + } + readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; readonly attribute optional OccupancyBitmap occupancy = 2; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java index 04af0f6bd2afb4..057ca1e046757f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java @@ -5825,6 +5825,509 @@ public String toString() { return output.toString(); } } +public static class ThermostatClusterSystemModeChangeEvent { + public Optional previousSystemMode; + public Integer currentSystemMode; + private static final long PREVIOUS_SYSTEM_MODE_ID = 0L; + private static final long CURRENT_SYSTEM_MODE_ID = 1L; + + public ThermostatClusterSystemModeChangeEvent( + Optional previousSystemMode, + Integer currentSystemMode + ) { + this.previousSystemMode = previousSystemMode; + this.currentSystemMode = currentSystemMode; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(PREVIOUS_SYSTEM_MODE_ID, previousSystemMode.map((nonOptionalpreviousSystemMode) -> new UIntType(nonOptionalpreviousSystemMode)).orElse(new EmptyType()))); + values.add(new StructElement(CURRENT_SYSTEM_MODE_ID, new UIntType(currentSystemMode))); + + return new StructType(values); + } + + public static ThermostatClusterSystemModeChangeEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Optional previousSystemMode = Optional.empty(); + Integer currentSystemMode = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == PREVIOUS_SYSTEM_MODE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + previousSystemMode = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == CURRENT_SYSTEM_MODE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + currentSystemMode = castingValue.value(Integer.class); + } + } + } + return new ThermostatClusterSystemModeChangeEvent( + previousSystemMode, + currentSystemMode + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ThermostatClusterSystemModeChangeEvent {\n"); + output.append("\tpreviousSystemMode: "); + output.append(previousSystemMode); + output.append("\n"); + output.append("\tcurrentSystemMode: "); + output.append(currentSystemMode); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ThermostatClusterLocalTemperatureChangeEvent { + public @Nullable Integer currentLocalTemperature; + private static final long CURRENT_LOCAL_TEMPERATURE_ID = 0L; + + public ThermostatClusterLocalTemperatureChangeEvent( + @Nullable Integer currentLocalTemperature + ) { + this.currentLocalTemperature = currentLocalTemperature; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(CURRENT_LOCAL_TEMPERATURE_ID, currentLocalTemperature != null ? new IntType(currentLocalTemperature) : new NullType())); + + return new StructType(values); + } + + public static ThermostatClusterLocalTemperatureChangeEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + @Nullable Integer currentLocalTemperature = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == CURRENT_LOCAL_TEMPERATURE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + currentLocalTemperature = castingValue.value(Integer.class); + } + } + } + return new ThermostatClusterLocalTemperatureChangeEvent( + currentLocalTemperature + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ThermostatClusterLocalTemperatureChangeEvent {\n"); + output.append("\tcurrentLocalTemperature: "); + output.append(currentLocalTemperature); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ThermostatClusterOccupancyChangeEvent { + public Optional previousOccupancy; + public Integer currentOccupancy; + private static final long PREVIOUS_OCCUPANCY_ID = 0L; + private static final long CURRENT_OCCUPANCY_ID = 1L; + + public ThermostatClusterOccupancyChangeEvent( + Optional previousOccupancy, + Integer currentOccupancy + ) { + this.previousOccupancy = previousOccupancy; + this.currentOccupancy = currentOccupancy; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(PREVIOUS_OCCUPANCY_ID, previousOccupancy.map((nonOptionalpreviousOccupancy) -> new UIntType(nonOptionalpreviousOccupancy)).orElse(new EmptyType()))); + values.add(new StructElement(CURRENT_OCCUPANCY_ID, new UIntType(currentOccupancy))); + + return new StructType(values); + } + + public static ThermostatClusterOccupancyChangeEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Optional previousOccupancy = Optional.empty(); + Integer currentOccupancy = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == PREVIOUS_OCCUPANCY_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + previousOccupancy = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == CURRENT_OCCUPANCY_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + currentOccupancy = castingValue.value(Integer.class); + } + } + } + return new ThermostatClusterOccupancyChangeEvent( + previousOccupancy, + currentOccupancy + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ThermostatClusterOccupancyChangeEvent {\n"); + output.append("\tpreviousOccupancy: "); + output.append(previousOccupancy); + output.append("\n"); + output.append("\tcurrentOccupancy: "); + output.append(currentOccupancy); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ThermostatClusterSetpointChangeEvent { + public Integer systemMode; + public Optional occupancy; + public Optional previousSetpoint; + public Integer currentSetpoint; + private static final long SYSTEM_MODE_ID = 0L; + private static final long OCCUPANCY_ID = 1L; + private static final long PREVIOUS_SETPOINT_ID = 2L; + private static final long CURRENT_SETPOINT_ID = 3L; + + public ThermostatClusterSetpointChangeEvent( + Integer systemMode, + Optional occupancy, + Optional previousSetpoint, + Integer currentSetpoint + ) { + this.systemMode = systemMode; + this.occupancy = occupancy; + this.previousSetpoint = previousSetpoint; + this.currentSetpoint = currentSetpoint; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(SYSTEM_MODE_ID, new UIntType(systemMode))); + values.add(new StructElement(OCCUPANCY_ID, occupancy.map((nonOptionaloccupancy) -> new UIntType(nonOptionaloccupancy)).orElse(new EmptyType()))); + values.add(new StructElement(PREVIOUS_SETPOINT_ID, previousSetpoint.map((nonOptionalpreviousSetpoint) -> new IntType(nonOptionalpreviousSetpoint)).orElse(new EmptyType()))); + values.add(new StructElement(CURRENT_SETPOINT_ID, new IntType(currentSetpoint))); + + return new StructType(values); + } + + public static ThermostatClusterSetpointChangeEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer systemMode = null; + Optional occupancy = Optional.empty(); + Optional previousSetpoint = Optional.empty(); + Integer currentSetpoint = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == SYSTEM_MODE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + systemMode = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == OCCUPANCY_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + occupancy = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == PREVIOUS_SETPOINT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + previousSetpoint = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == CURRENT_SETPOINT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + currentSetpoint = castingValue.value(Integer.class); + } + } + } + return new ThermostatClusterSetpointChangeEvent( + systemMode, + occupancy, + previousSetpoint, + currentSetpoint + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ThermostatClusterSetpointChangeEvent {\n"); + output.append("\tsystemMode: "); + output.append(systemMode); + output.append("\n"); + output.append("\toccupancy: "); + output.append(occupancy); + output.append("\n"); + output.append("\tpreviousSetpoint: "); + output.append(previousSetpoint); + output.append("\n"); + output.append("\tcurrentSetpoint: "); + output.append(currentSetpoint); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ThermostatClusterRunningStateChangeEvent { + public Optional previousRunningState; + public Integer currentRunningState; + private static final long PREVIOUS_RUNNING_STATE_ID = 0L; + private static final long CURRENT_RUNNING_STATE_ID = 1L; + + public ThermostatClusterRunningStateChangeEvent( + Optional previousRunningState, + Integer currentRunningState + ) { + this.previousRunningState = previousRunningState; + this.currentRunningState = currentRunningState; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(PREVIOUS_RUNNING_STATE_ID, previousRunningState.map((nonOptionalpreviousRunningState) -> new UIntType(nonOptionalpreviousRunningState)).orElse(new EmptyType()))); + values.add(new StructElement(CURRENT_RUNNING_STATE_ID, new UIntType(currentRunningState))); + + return new StructType(values); + } + + public static ThermostatClusterRunningStateChangeEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Optional previousRunningState = Optional.empty(); + Integer currentRunningState = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == PREVIOUS_RUNNING_STATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + previousRunningState = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == CURRENT_RUNNING_STATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + currentRunningState = castingValue.value(Integer.class); + } + } + } + return new ThermostatClusterRunningStateChangeEvent( + previousRunningState, + currentRunningState + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ThermostatClusterRunningStateChangeEvent {\n"); + output.append("\tpreviousRunningState: "); + output.append(previousRunningState); + output.append("\n"); + output.append("\tcurrentRunningState: "); + output.append(currentRunningState); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ThermostatClusterRunningModeChangeEvent { + public Optional previousRunningMode; + public Integer currentRunningMode; + private static final long PREVIOUS_RUNNING_MODE_ID = 0L; + private static final long CURRENT_RUNNING_MODE_ID = 1L; + + public ThermostatClusterRunningModeChangeEvent( + Optional previousRunningMode, + Integer currentRunningMode + ) { + this.previousRunningMode = previousRunningMode; + this.currentRunningMode = currentRunningMode; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(PREVIOUS_RUNNING_MODE_ID, previousRunningMode.map((nonOptionalpreviousRunningMode) -> new UIntType(nonOptionalpreviousRunningMode)).orElse(new EmptyType()))); + values.add(new StructElement(CURRENT_RUNNING_MODE_ID, new UIntType(currentRunningMode))); + + return new StructType(values); + } + + public static ThermostatClusterRunningModeChangeEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Optional previousRunningMode = Optional.empty(); + Integer currentRunningMode = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == PREVIOUS_RUNNING_MODE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + previousRunningMode = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == CURRENT_RUNNING_MODE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + currentRunningMode = castingValue.value(Integer.class); + } + } + } + return new ThermostatClusterRunningModeChangeEvent( + previousRunningMode, + currentRunningMode + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ThermostatClusterRunningModeChangeEvent {\n"); + output.append("\tpreviousRunningMode: "); + output.append(previousRunningMode); + output.append("\n"); + output.append("\tcurrentRunningMode: "); + output.append(currentRunningMode); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ThermostatClusterActiveScheduleChangeEvent { + public @Nullable Optional previousScheduleHandle; + public @Nullable byte[] currentScheduleHandle; + private static final long PREVIOUS_SCHEDULE_HANDLE_ID = 0L; + private static final long CURRENT_SCHEDULE_HANDLE_ID = 1L; + + public ThermostatClusterActiveScheduleChangeEvent( + @Nullable Optional previousScheduleHandle, + @Nullable byte[] currentScheduleHandle + ) { + this.previousScheduleHandle = previousScheduleHandle; + this.currentScheduleHandle = currentScheduleHandle; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(PREVIOUS_SCHEDULE_HANDLE_ID, previousScheduleHandle != null ? previousScheduleHandle.map((nonOptionalpreviousScheduleHandle) -> new ByteArrayType(nonOptionalpreviousScheduleHandle)).orElse(new EmptyType()) : new NullType())); + values.add(new StructElement(CURRENT_SCHEDULE_HANDLE_ID, currentScheduleHandle != null ? new ByteArrayType(currentScheduleHandle) : new NullType())); + + return new StructType(values); + } + + public static ThermostatClusterActiveScheduleChangeEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + @Nullable Optional previousScheduleHandle = null; + @Nullable byte[] currentScheduleHandle = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == PREVIOUS_SCHEDULE_HANDLE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) { + ByteArrayType castingValue = element.value(ByteArrayType.class); + previousScheduleHandle = Optional.of(castingValue.value(byte[].class)); + } + } else if (element.contextTagNum() == CURRENT_SCHEDULE_HANDLE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) { + ByteArrayType castingValue = element.value(ByteArrayType.class); + currentScheduleHandle = castingValue.value(byte[].class); + } + } + } + return new ThermostatClusterActiveScheduleChangeEvent( + previousScheduleHandle, + currentScheduleHandle + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ThermostatClusterActiveScheduleChangeEvent {\n"); + output.append("\tpreviousScheduleHandle: "); + output.append(previousScheduleHandle.isPresent() ? Arrays.toString(previousScheduleHandle.get()) : ""); + output.append("\n"); + output.append("\tcurrentScheduleHandle: "); + output.append(Arrays.toString(currentScheduleHandle)); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ThermostatClusterActivePresetChangeEvent { + public @Nullable Optional previousPresetHandle; + public @Nullable byte[] currentPresetHandle; + private static final long PREVIOUS_PRESET_HANDLE_ID = 0L; + private static final long CURRENT_PRESET_HANDLE_ID = 1L; + + public ThermostatClusterActivePresetChangeEvent( + @Nullable Optional previousPresetHandle, + @Nullable byte[] currentPresetHandle + ) { + this.previousPresetHandle = previousPresetHandle; + this.currentPresetHandle = currentPresetHandle; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(PREVIOUS_PRESET_HANDLE_ID, previousPresetHandle != null ? previousPresetHandle.map((nonOptionalpreviousPresetHandle) -> new ByteArrayType(nonOptionalpreviousPresetHandle)).orElse(new EmptyType()) : new NullType())); + values.add(new StructElement(CURRENT_PRESET_HANDLE_ID, currentPresetHandle != null ? new ByteArrayType(currentPresetHandle) : new NullType())); + + return new StructType(values); + } + + public static ThermostatClusterActivePresetChangeEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + @Nullable Optional previousPresetHandle = null; + @Nullable byte[] currentPresetHandle = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == PREVIOUS_PRESET_HANDLE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) { + ByteArrayType castingValue = element.value(ByteArrayType.class); + previousPresetHandle = Optional.of(castingValue.value(byte[].class)); + } + } else if (element.contextTagNum() == CURRENT_PRESET_HANDLE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) { + ByteArrayType castingValue = element.value(ByteArrayType.class); + currentPresetHandle = castingValue.value(byte[].class); + } + } + } + return new ThermostatClusterActivePresetChangeEvent( + previousPresetHandle, + currentPresetHandle + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ThermostatClusterActivePresetChangeEvent {\n"); + output.append("\tpreviousPresetHandle: "); + output.append(previousPresetHandle.isPresent() ? Arrays.toString(previousPresetHandle.get()) : ""); + output.append("\n"); + output.append("\tcurrentPresetHandle: "); + output.append(Arrays.toString(currentPresetHandle)); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class OccupancySensingClusterOccupancyChangedEvent { public Integer occupancy; private static final long OCCUPANCY_ID = 0L; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 64242e9ab049a7..99d61c96dd0708 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -11857,7 +11857,15 @@ public static Attribute value(long id) throws NoSuchFieldError { } } - public enum Event {; + public enum Event { + SystemModeChange(0L), + LocalTemperatureChange(1L), + OccupancyChange(2L), + SetpointChange(3L), + RunningStateChange(4L), + RunningModeChange(5L), + ActiveScheduleChange(6L), + ActivePresetChange(7L),; private final long id; Event(long id) { this.id = id; diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterActivePresetChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterActivePresetChangeEvent.kt new file mode 100644 index 00000000000000..2d083403f13016 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterActivePresetChangeEvent.kt @@ -0,0 +1,87 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterActivePresetChangeEvent( + val previousPresetHandle: Optional?, + val currentPresetHandle: ByteArray?, +) { + override fun toString(): String = buildString { + append("ThermostatClusterActivePresetChangeEvent {\n") + append("\tpreviousPresetHandle : $previousPresetHandle\n") + append("\tcurrentPresetHandle : $currentPresetHandle\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (previousPresetHandle != null) { + if (previousPresetHandle.isPresent) { + val optpreviousPresetHandle = previousPresetHandle.get() + put(ContextSpecificTag(TAG_PREVIOUS_PRESET_HANDLE), optpreviousPresetHandle) + } + } else { + putNull(ContextSpecificTag(TAG_PREVIOUS_PRESET_HANDLE)) + } + if (currentPresetHandle != null) { + put(ContextSpecificTag(TAG_CURRENT_PRESET_HANDLE), currentPresetHandle) + } else { + putNull(ContextSpecificTag(TAG_CURRENT_PRESET_HANDLE)) + } + endStructure() + } + } + + companion object { + private const val TAG_PREVIOUS_PRESET_HANDLE = 0 + private const val TAG_CURRENT_PRESET_HANDLE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterActivePresetChangeEvent { + tlvReader.enterStructure(tlvTag) + val previousPresetHandle = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PREVIOUS_PRESET_HANDLE))) { + Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_PREVIOUS_PRESET_HANDLE))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PREVIOUS_PRESET_HANDLE)) + null + } + val currentPresetHandle = + if (!tlvReader.isNull()) { + tlvReader.getByteArray(ContextSpecificTag(TAG_CURRENT_PRESET_HANDLE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_CURRENT_PRESET_HANDLE)) + null + } + + tlvReader.exitContainer() + + return ThermostatClusterActivePresetChangeEvent(previousPresetHandle, currentPresetHandle) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterActiveScheduleChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterActiveScheduleChangeEvent.kt new file mode 100644 index 00000000000000..dfe8deeadbc0fa --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterActiveScheduleChangeEvent.kt @@ -0,0 +1,90 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterActiveScheduleChangeEvent( + val previousScheduleHandle: Optional?, + val currentScheduleHandle: ByteArray?, +) { + override fun toString(): String = buildString { + append("ThermostatClusterActiveScheduleChangeEvent {\n") + append("\tpreviousScheduleHandle : $previousScheduleHandle\n") + append("\tcurrentScheduleHandle : $currentScheduleHandle\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (previousScheduleHandle != null) { + if (previousScheduleHandle.isPresent) { + val optpreviousScheduleHandle = previousScheduleHandle.get() + put(ContextSpecificTag(TAG_PREVIOUS_SCHEDULE_HANDLE), optpreviousScheduleHandle) + } + } else { + putNull(ContextSpecificTag(TAG_PREVIOUS_SCHEDULE_HANDLE)) + } + if (currentScheduleHandle != null) { + put(ContextSpecificTag(TAG_CURRENT_SCHEDULE_HANDLE), currentScheduleHandle) + } else { + putNull(ContextSpecificTag(TAG_CURRENT_SCHEDULE_HANDLE)) + } + endStructure() + } + } + + companion object { + private const val TAG_PREVIOUS_SCHEDULE_HANDLE = 0 + private const val TAG_CURRENT_SCHEDULE_HANDLE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterActiveScheduleChangeEvent { + tlvReader.enterStructure(tlvTag) + val previousScheduleHandle = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PREVIOUS_SCHEDULE_HANDLE))) { + Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_PREVIOUS_SCHEDULE_HANDLE))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PREVIOUS_SCHEDULE_HANDLE)) + null + } + val currentScheduleHandle = + if (!tlvReader.isNull()) { + tlvReader.getByteArray(ContextSpecificTag(TAG_CURRENT_SCHEDULE_HANDLE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_CURRENT_SCHEDULE_HANDLE)) + null + } + + tlvReader.exitContainer() + + return ThermostatClusterActiveScheduleChangeEvent( + previousScheduleHandle, + currentScheduleHandle, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterLocalTemperatureChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterLocalTemperatureChangeEvent.kt new file mode 100644 index 00000000000000..93fde33d356368 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterLocalTemperatureChangeEvent.kt @@ -0,0 +1,62 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterLocalTemperatureChangeEvent(val currentLocalTemperature: Int?) { + override fun toString(): String = buildString { + append("ThermostatClusterLocalTemperatureChangeEvent {\n") + append("\tcurrentLocalTemperature : $currentLocalTemperature\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (currentLocalTemperature != null) { + put(ContextSpecificTag(TAG_CURRENT_LOCAL_TEMPERATURE), currentLocalTemperature) + } else { + putNull(ContextSpecificTag(TAG_CURRENT_LOCAL_TEMPERATURE)) + } + endStructure() + } + } + + companion object { + private const val TAG_CURRENT_LOCAL_TEMPERATURE = 0 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterLocalTemperatureChangeEvent { + tlvReader.enterStructure(tlvTag) + val currentLocalTemperature = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_CURRENT_LOCAL_TEMPERATURE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_CURRENT_LOCAL_TEMPERATURE)) + null + } + + tlvReader.exitContainer() + + return ThermostatClusterLocalTemperatureChangeEvent(currentLocalTemperature) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterOccupancyChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterOccupancyChangeEvent.kt new file mode 100644 index 00000000000000..8cf02d2d1e8552 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterOccupancyChangeEvent.kt @@ -0,0 +1,68 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterOccupancyChangeEvent( + val previousOccupancy: Optional, + val currentOccupancy: UInt, +) { + override fun toString(): String = buildString { + append("ThermostatClusterOccupancyChangeEvent {\n") + append("\tpreviousOccupancy : $previousOccupancy\n") + append("\tcurrentOccupancy : $currentOccupancy\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (previousOccupancy.isPresent) { + val optpreviousOccupancy = previousOccupancy.get() + put(ContextSpecificTag(TAG_PREVIOUS_OCCUPANCY), optpreviousOccupancy) + } + put(ContextSpecificTag(TAG_CURRENT_OCCUPANCY), currentOccupancy) + endStructure() + } + } + + companion object { + private const val TAG_PREVIOUS_OCCUPANCY = 0 + private const val TAG_CURRENT_OCCUPANCY = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterOccupancyChangeEvent { + tlvReader.enterStructure(tlvTag) + val previousOccupancy = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PREVIOUS_OCCUPANCY))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_PREVIOUS_OCCUPANCY))) + } else { + Optional.empty() + } + val currentOccupancy = tlvReader.getUInt(ContextSpecificTag(TAG_CURRENT_OCCUPANCY)) + + tlvReader.exitContainer() + + return ThermostatClusterOccupancyChangeEvent(previousOccupancy, currentOccupancy) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterRunningModeChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterRunningModeChangeEvent.kt new file mode 100644 index 00000000000000..0ad3dffb3dbeb2 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterRunningModeChangeEvent.kt @@ -0,0 +1,68 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterRunningModeChangeEvent( + val previousRunningMode: Optional, + val currentRunningMode: UInt, +) { + override fun toString(): String = buildString { + append("ThermostatClusterRunningModeChangeEvent {\n") + append("\tpreviousRunningMode : $previousRunningMode\n") + append("\tcurrentRunningMode : $currentRunningMode\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (previousRunningMode.isPresent) { + val optpreviousRunningMode = previousRunningMode.get() + put(ContextSpecificTag(TAG_PREVIOUS_RUNNING_MODE), optpreviousRunningMode) + } + put(ContextSpecificTag(TAG_CURRENT_RUNNING_MODE), currentRunningMode) + endStructure() + } + } + + companion object { + private const val TAG_PREVIOUS_RUNNING_MODE = 0 + private const val TAG_CURRENT_RUNNING_MODE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterRunningModeChangeEvent { + tlvReader.enterStructure(tlvTag) + val previousRunningMode = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PREVIOUS_RUNNING_MODE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_PREVIOUS_RUNNING_MODE))) + } else { + Optional.empty() + } + val currentRunningMode = tlvReader.getUInt(ContextSpecificTag(TAG_CURRENT_RUNNING_MODE)) + + tlvReader.exitContainer() + + return ThermostatClusterRunningModeChangeEvent(previousRunningMode, currentRunningMode) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterRunningStateChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterRunningStateChangeEvent.kt new file mode 100644 index 00000000000000..510ccf9f878a9c --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterRunningStateChangeEvent.kt @@ -0,0 +1,68 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterRunningStateChangeEvent( + val previousRunningState: Optional, + val currentRunningState: UInt, +) { + override fun toString(): String = buildString { + append("ThermostatClusterRunningStateChangeEvent {\n") + append("\tpreviousRunningState : $previousRunningState\n") + append("\tcurrentRunningState : $currentRunningState\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (previousRunningState.isPresent) { + val optpreviousRunningState = previousRunningState.get() + put(ContextSpecificTag(TAG_PREVIOUS_RUNNING_STATE), optpreviousRunningState) + } + put(ContextSpecificTag(TAG_CURRENT_RUNNING_STATE), currentRunningState) + endStructure() + } + } + + companion object { + private const val TAG_PREVIOUS_RUNNING_STATE = 0 + private const val TAG_CURRENT_RUNNING_STATE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterRunningStateChangeEvent { + tlvReader.enterStructure(tlvTag) + val previousRunningState = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PREVIOUS_RUNNING_STATE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_PREVIOUS_RUNNING_STATE))) + } else { + Optional.empty() + } + val currentRunningState = tlvReader.getUInt(ContextSpecificTag(TAG_CURRENT_RUNNING_STATE)) + + tlvReader.exitContainer() + + return ThermostatClusterRunningStateChangeEvent(previousRunningState, currentRunningState) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterSetpointChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterSetpointChangeEvent.kt new file mode 100644 index 00000000000000..bcb032a52d19d1 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterSetpointChangeEvent.kt @@ -0,0 +1,91 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterSetpointChangeEvent( + val systemMode: UInt, + val occupancy: Optional, + val previousSetpoint: Optional, + val currentSetpoint: Int, +) { + override fun toString(): String = buildString { + append("ThermostatClusterSetpointChangeEvent {\n") + append("\tsystemMode : $systemMode\n") + append("\toccupancy : $occupancy\n") + append("\tpreviousSetpoint : $previousSetpoint\n") + append("\tcurrentSetpoint : $currentSetpoint\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SYSTEM_MODE), systemMode) + if (occupancy.isPresent) { + val optoccupancy = occupancy.get() + put(ContextSpecificTag(TAG_OCCUPANCY), optoccupancy) + } + if (previousSetpoint.isPresent) { + val optpreviousSetpoint = previousSetpoint.get() + put(ContextSpecificTag(TAG_PREVIOUS_SETPOINT), optpreviousSetpoint) + } + put(ContextSpecificTag(TAG_CURRENT_SETPOINT), currentSetpoint) + endStructure() + } + } + + companion object { + private const val TAG_SYSTEM_MODE = 0 + private const val TAG_OCCUPANCY = 1 + private const val TAG_PREVIOUS_SETPOINT = 2 + private const val TAG_CURRENT_SETPOINT = 3 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterSetpointChangeEvent { + tlvReader.enterStructure(tlvTag) + val systemMode = tlvReader.getUInt(ContextSpecificTag(TAG_SYSTEM_MODE)) + val occupancy = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_OCCUPANCY))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_OCCUPANCY))) + } else { + Optional.empty() + } + val previousSetpoint = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PREVIOUS_SETPOINT))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_PREVIOUS_SETPOINT))) + } else { + Optional.empty() + } + val currentSetpoint = tlvReader.getInt(ContextSpecificTag(TAG_CURRENT_SETPOINT)) + + tlvReader.exitContainer() + + return ThermostatClusterSetpointChangeEvent( + systemMode, + occupancy, + previousSetpoint, + currentSetpoint, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterSystemModeChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterSystemModeChangeEvent.kt new file mode 100644 index 00000000000000..c32b2c1b7aea5d --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterSystemModeChangeEvent.kt @@ -0,0 +1,68 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterSystemModeChangeEvent( + val previousSystemMode: Optional, + val currentSystemMode: UInt, +) { + override fun toString(): String = buildString { + append("ThermostatClusterSystemModeChangeEvent {\n") + append("\tpreviousSystemMode : $previousSystemMode\n") + append("\tcurrentSystemMode : $currentSystemMode\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (previousSystemMode.isPresent) { + val optpreviousSystemMode = previousSystemMode.get() + put(ContextSpecificTag(TAG_PREVIOUS_SYSTEM_MODE), optpreviousSystemMode) + } + put(ContextSpecificTag(TAG_CURRENT_SYSTEM_MODE), currentSystemMode) + endStructure() + } + } + + companion object { + private const val TAG_PREVIOUS_SYSTEM_MODE = 0 + private const val TAG_CURRENT_SYSTEM_MODE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterSystemModeChangeEvent { + tlvReader.enterStructure(tlvTag) + val previousSystemMode = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PREVIOUS_SYSTEM_MODE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_PREVIOUS_SYSTEM_MODE))) + } else { + Optional.empty() + } + val currentSystemMode = tlvReader.getUInt(ContextSpecificTag(TAG_CURRENT_SYSTEM_MODE)) + + tlvReader.exitContainer() + + return ThermostatClusterSystemModeChangeEvent(previousSystemMode, currentSystemMode) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni index 8c1864dd3cb333..eab80f35f0f1f4 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -268,6 +268,14 @@ eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterShortReleaseEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterSwitchLatchedEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TargetNavigatorClusterTargetUpdatedEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterActivePresetChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterActiveScheduleChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterLocalTemperatureChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterOccupancyChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterRunningModeChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterRunningStateChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterSetpointChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThermostatClusterSystemModeChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterConnectionStatusEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterDSTStatusEvent.kt", diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterActivePresetChangeEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterActivePresetChangeEvent.kt new file mode 100644 index 00000000000000..2f4992fdb49615 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterActivePresetChangeEvent.kt @@ -0,0 +1,87 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.eventstructs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterActivePresetChangeEvent( + val previousPresetHandle: Optional?, + val currentPresetHandle: ByteArray?, +) { + override fun toString(): String = buildString { + append("ThermostatClusterActivePresetChangeEvent {\n") + append("\tpreviousPresetHandle : $previousPresetHandle\n") + append("\tcurrentPresetHandle : $currentPresetHandle\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (previousPresetHandle != null) { + if (previousPresetHandle.isPresent) { + val optpreviousPresetHandle = previousPresetHandle.get() + put(ContextSpecificTag(TAG_PREVIOUS_PRESET_HANDLE), optpreviousPresetHandle) + } + } else { + putNull(ContextSpecificTag(TAG_PREVIOUS_PRESET_HANDLE)) + } + if (currentPresetHandle != null) { + put(ContextSpecificTag(TAG_CURRENT_PRESET_HANDLE), currentPresetHandle) + } else { + putNull(ContextSpecificTag(TAG_CURRENT_PRESET_HANDLE)) + } + endStructure() + } + } + + companion object { + private const val TAG_PREVIOUS_PRESET_HANDLE = 0 + private const val TAG_CURRENT_PRESET_HANDLE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterActivePresetChangeEvent { + tlvReader.enterStructure(tlvTag) + val previousPresetHandle = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PREVIOUS_PRESET_HANDLE))) { + Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_PREVIOUS_PRESET_HANDLE))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PREVIOUS_PRESET_HANDLE)) + null + } + val currentPresetHandle = + if (!tlvReader.isNull()) { + tlvReader.getByteArray(ContextSpecificTag(TAG_CURRENT_PRESET_HANDLE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_CURRENT_PRESET_HANDLE)) + null + } + + tlvReader.exitContainer() + + return ThermostatClusterActivePresetChangeEvent(previousPresetHandle, currentPresetHandle) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterActiveScheduleChangeEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterActiveScheduleChangeEvent.kt new file mode 100644 index 00000000000000..b90f21d2621efa --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterActiveScheduleChangeEvent.kt @@ -0,0 +1,90 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.eventstructs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterActiveScheduleChangeEvent( + val previousScheduleHandle: Optional?, + val currentScheduleHandle: ByteArray?, +) { + override fun toString(): String = buildString { + append("ThermostatClusterActiveScheduleChangeEvent {\n") + append("\tpreviousScheduleHandle : $previousScheduleHandle\n") + append("\tcurrentScheduleHandle : $currentScheduleHandle\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (previousScheduleHandle != null) { + if (previousScheduleHandle.isPresent) { + val optpreviousScheduleHandle = previousScheduleHandle.get() + put(ContextSpecificTag(TAG_PREVIOUS_SCHEDULE_HANDLE), optpreviousScheduleHandle) + } + } else { + putNull(ContextSpecificTag(TAG_PREVIOUS_SCHEDULE_HANDLE)) + } + if (currentScheduleHandle != null) { + put(ContextSpecificTag(TAG_CURRENT_SCHEDULE_HANDLE), currentScheduleHandle) + } else { + putNull(ContextSpecificTag(TAG_CURRENT_SCHEDULE_HANDLE)) + } + endStructure() + } + } + + companion object { + private const val TAG_PREVIOUS_SCHEDULE_HANDLE = 0 + private const val TAG_CURRENT_SCHEDULE_HANDLE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterActiveScheduleChangeEvent { + tlvReader.enterStructure(tlvTag) + val previousScheduleHandle = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PREVIOUS_SCHEDULE_HANDLE))) { + Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_PREVIOUS_SCHEDULE_HANDLE))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PREVIOUS_SCHEDULE_HANDLE)) + null + } + val currentScheduleHandle = + if (!tlvReader.isNull()) { + tlvReader.getByteArray(ContextSpecificTag(TAG_CURRENT_SCHEDULE_HANDLE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_CURRENT_SCHEDULE_HANDLE)) + null + } + + tlvReader.exitContainer() + + return ThermostatClusterActiveScheduleChangeEvent( + previousScheduleHandle, + currentScheduleHandle, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterLocalTemperatureChangeEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterLocalTemperatureChangeEvent.kt new file mode 100644 index 00000000000000..5e3898372d3561 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterLocalTemperatureChangeEvent.kt @@ -0,0 +1,62 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.eventstructs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterLocalTemperatureChangeEvent(val currentLocalTemperature: Short?) { + override fun toString(): String = buildString { + append("ThermostatClusterLocalTemperatureChangeEvent {\n") + append("\tcurrentLocalTemperature : $currentLocalTemperature\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (currentLocalTemperature != null) { + put(ContextSpecificTag(TAG_CURRENT_LOCAL_TEMPERATURE), currentLocalTemperature) + } else { + putNull(ContextSpecificTag(TAG_CURRENT_LOCAL_TEMPERATURE)) + } + endStructure() + } + } + + companion object { + private const val TAG_CURRENT_LOCAL_TEMPERATURE = 0 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterLocalTemperatureChangeEvent { + tlvReader.enterStructure(tlvTag) + val currentLocalTemperature = + if (!tlvReader.isNull()) { + tlvReader.getShort(ContextSpecificTag(TAG_CURRENT_LOCAL_TEMPERATURE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_CURRENT_LOCAL_TEMPERATURE)) + null + } + + tlvReader.exitContainer() + + return ThermostatClusterLocalTemperatureChangeEvent(currentLocalTemperature) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterOccupancyChangeEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterOccupancyChangeEvent.kt new file mode 100644 index 00000000000000..8988c66d6a493d --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterOccupancyChangeEvent.kt @@ -0,0 +1,68 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.eventstructs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterOccupancyChangeEvent( + val previousOccupancy: Optional, + val currentOccupancy: UByte, +) { + override fun toString(): String = buildString { + append("ThermostatClusterOccupancyChangeEvent {\n") + append("\tpreviousOccupancy : $previousOccupancy\n") + append("\tcurrentOccupancy : $currentOccupancy\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (previousOccupancy.isPresent) { + val optpreviousOccupancy = previousOccupancy.get() + put(ContextSpecificTag(TAG_PREVIOUS_OCCUPANCY), optpreviousOccupancy) + } + put(ContextSpecificTag(TAG_CURRENT_OCCUPANCY), currentOccupancy) + endStructure() + } + } + + companion object { + private const val TAG_PREVIOUS_OCCUPANCY = 0 + private const val TAG_CURRENT_OCCUPANCY = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterOccupancyChangeEvent { + tlvReader.enterStructure(tlvTag) + val previousOccupancy = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PREVIOUS_OCCUPANCY))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_PREVIOUS_OCCUPANCY))) + } else { + Optional.empty() + } + val currentOccupancy = tlvReader.getUByte(ContextSpecificTag(TAG_CURRENT_OCCUPANCY)) + + tlvReader.exitContainer() + + return ThermostatClusterOccupancyChangeEvent(previousOccupancy, currentOccupancy) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterRunningModeChangeEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterRunningModeChangeEvent.kt new file mode 100644 index 00000000000000..f6d1f7b97e668e --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterRunningModeChangeEvent.kt @@ -0,0 +1,68 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.eventstructs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterRunningModeChangeEvent( + val previousRunningMode: Optional, + val currentRunningMode: UByte, +) { + override fun toString(): String = buildString { + append("ThermostatClusterRunningModeChangeEvent {\n") + append("\tpreviousRunningMode : $previousRunningMode\n") + append("\tcurrentRunningMode : $currentRunningMode\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (previousRunningMode.isPresent) { + val optpreviousRunningMode = previousRunningMode.get() + put(ContextSpecificTag(TAG_PREVIOUS_RUNNING_MODE), optpreviousRunningMode) + } + put(ContextSpecificTag(TAG_CURRENT_RUNNING_MODE), currentRunningMode) + endStructure() + } + } + + companion object { + private const val TAG_PREVIOUS_RUNNING_MODE = 0 + private const val TAG_CURRENT_RUNNING_MODE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterRunningModeChangeEvent { + tlvReader.enterStructure(tlvTag) + val previousRunningMode = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PREVIOUS_RUNNING_MODE))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_PREVIOUS_RUNNING_MODE))) + } else { + Optional.empty() + } + val currentRunningMode = tlvReader.getUByte(ContextSpecificTag(TAG_CURRENT_RUNNING_MODE)) + + tlvReader.exitContainer() + + return ThermostatClusterRunningModeChangeEvent(previousRunningMode, currentRunningMode) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterRunningStateChangeEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterRunningStateChangeEvent.kt new file mode 100644 index 00000000000000..c0be2722721fa4 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterRunningStateChangeEvent.kt @@ -0,0 +1,68 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.eventstructs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterRunningStateChangeEvent( + val previousRunningState: Optional, + val currentRunningState: UShort, +) { + override fun toString(): String = buildString { + append("ThermostatClusterRunningStateChangeEvent {\n") + append("\tpreviousRunningState : $previousRunningState\n") + append("\tcurrentRunningState : $currentRunningState\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (previousRunningState.isPresent) { + val optpreviousRunningState = previousRunningState.get() + put(ContextSpecificTag(TAG_PREVIOUS_RUNNING_STATE), optpreviousRunningState) + } + put(ContextSpecificTag(TAG_CURRENT_RUNNING_STATE), currentRunningState) + endStructure() + } + } + + companion object { + private const val TAG_PREVIOUS_RUNNING_STATE = 0 + private const val TAG_CURRENT_RUNNING_STATE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterRunningStateChangeEvent { + tlvReader.enterStructure(tlvTag) + val previousRunningState = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PREVIOUS_RUNNING_STATE))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_PREVIOUS_RUNNING_STATE))) + } else { + Optional.empty() + } + val currentRunningState = tlvReader.getUShort(ContextSpecificTag(TAG_CURRENT_RUNNING_STATE)) + + tlvReader.exitContainer() + + return ThermostatClusterRunningStateChangeEvent(previousRunningState, currentRunningState) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterSetpointChangeEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterSetpointChangeEvent.kt new file mode 100644 index 00000000000000..f1cf54e6a409e4 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterSetpointChangeEvent.kt @@ -0,0 +1,91 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.eventstructs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterSetpointChangeEvent( + val systemMode: UByte, + val occupancy: Optional, + val previousSetpoint: Optional, + val currentSetpoint: Short, +) { + override fun toString(): String = buildString { + append("ThermostatClusterSetpointChangeEvent {\n") + append("\tsystemMode : $systemMode\n") + append("\toccupancy : $occupancy\n") + append("\tpreviousSetpoint : $previousSetpoint\n") + append("\tcurrentSetpoint : $currentSetpoint\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SYSTEM_MODE), systemMode) + if (occupancy.isPresent) { + val optoccupancy = occupancy.get() + put(ContextSpecificTag(TAG_OCCUPANCY), optoccupancy) + } + if (previousSetpoint.isPresent) { + val optpreviousSetpoint = previousSetpoint.get() + put(ContextSpecificTag(TAG_PREVIOUS_SETPOINT), optpreviousSetpoint) + } + put(ContextSpecificTag(TAG_CURRENT_SETPOINT), currentSetpoint) + endStructure() + } + } + + companion object { + private const val TAG_SYSTEM_MODE = 0 + private const val TAG_OCCUPANCY = 1 + private const val TAG_PREVIOUS_SETPOINT = 2 + private const val TAG_CURRENT_SETPOINT = 3 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterSetpointChangeEvent { + tlvReader.enterStructure(tlvTag) + val systemMode = tlvReader.getUByte(ContextSpecificTag(TAG_SYSTEM_MODE)) + val occupancy = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_OCCUPANCY))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_OCCUPANCY))) + } else { + Optional.empty() + } + val previousSetpoint = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PREVIOUS_SETPOINT))) { + Optional.of(tlvReader.getShort(ContextSpecificTag(TAG_PREVIOUS_SETPOINT))) + } else { + Optional.empty() + } + val currentSetpoint = tlvReader.getShort(ContextSpecificTag(TAG_CURRENT_SETPOINT)) + + tlvReader.exitContainer() + + return ThermostatClusterSetpointChangeEvent( + systemMode, + occupancy, + previousSetpoint, + currentSetpoint, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterSystemModeChangeEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterSystemModeChangeEvent.kt new file mode 100644 index 00000000000000..ee65aff45f658e --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterSystemModeChangeEvent.kt @@ -0,0 +1,68 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.eventstructs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterSystemModeChangeEvent( + val previousSystemMode: Optional, + val currentSystemMode: UByte, +) { + override fun toString(): String = buildString { + append("ThermostatClusterSystemModeChangeEvent {\n") + append("\tpreviousSystemMode : $previousSystemMode\n") + append("\tcurrentSystemMode : $currentSystemMode\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (previousSystemMode.isPresent) { + val optpreviousSystemMode = previousSystemMode.get() + put(ContextSpecificTag(TAG_PREVIOUS_SYSTEM_MODE), optpreviousSystemMode) + } + put(ContextSpecificTag(TAG_CURRENT_SYSTEM_MODE), currentSystemMode) + endStructure() + } + } + + companion object { + private const val TAG_PREVIOUS_SYSTEM_MODE = 0 + private const val TAG_CURRENT_SYSTEM_MODE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterSystemModeChangeEvent { + tlvReader.enterStructure(tlvTag) + val previousSystemMode = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PREVIOUS_SYSTEM_MODE))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_PREVIOUS_SYSTEM_MODE))) + } else { + Optional.empty() + } + val currentSystemMode = tlvReader.getUByte(ContextSpecificTag(TAG_CURRENT_SYSTEM_MODE)) + + tlvReader.exitContainer() + + return ThermostatClusterSystemModeChangeEvent(previousSystemMode, currentSystemMode) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni index e25dcf66937659..a56f382c0d0851 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -268,6 +268,14 @@ matter_eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/SwitchClusterShortReleaseEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/SwitchClusterSwitchLatchedEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/TargetNavigatorClusterTargetUpdatedEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterActivePresetChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterActiveScheduleChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterLocalTemperatureChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterOccupancyChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterRunningModeChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterRunningStateChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterSetpointChangeEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThermostatClusterSystemModeChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterConnectionStatusEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/TimeSynchronizationClusterDSTStatusEvent.kt", diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 606e7a760061ee..a400918974e1ab 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -7588,6 +7588,508 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & using namespace app::Clusters::Thermostat; switch (aPath.mEventId) { + case Events::SystemModeChange::Id: { + Events::SystemModeChange::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_previousSystemMode; + if (!cppValue.previousSystemMode.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_previousSystemMode); + } + else + { + jobject value_previousSystemModeInsideOptional; + std::string value_previousSystemModeInsideOptionalClassName = "java/lang/Integer"; + std::string value_previousSystemModeInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_previousSystemModeInsideOptional = static_cast(cppValue.previousSystemMode.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_previousSystemModeInsideOptionalClassName.c_str(), + value_previousSystemModeInsideOptionalCtorSignature.c_str(), jnivalue_previousSystemModeInsideOptional, + value_previousSystemModeInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_previousSystemModeInsideOptional, value_previousSystemMode); + } + + jobject value_currentSystemMode; + std::string value_currentSystemModeClassName = "java/lang/Integer"; + std::string value_currentSystemModeCtorSignature = "(I)V"; + jint jnivalue_currentSystemMode = static_cast(cppValue.currentSystemMode); + chip::JniReferences::GetInstance().CreateBoxedObject(value_currentSystemModeClassName.c_str(), + value_currentSystemModeCtorSignature.c_str(), + jnivalue_currentSystemMode, value_currentSystemMode); + + jclass systemModeChangeStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$ThermostatClusterSystemModeChangeEvent", systemModeChangeStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$ThermostatClusterSystemModeChangeEvent"); + return nullptr; + } + + jmethodID systemModeChangeStructCtor; + err = chip::JniReferences::GetInstance().FindMethod(env, systemModeChangeStructClass, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &systemModeChangeStructCtor); + if (err != CHIP_NO_ERROR || systemModeChangeStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$ThermostatClusterSystemModeChangeEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(systemModeChangeStructClass, systemModeChangeStructCtor, value_previousSystemMode, + value_currentSystemMode); + + return value; + } + case Events::LocalTemperatureChange::Id: { + Events::LocalTemperatureChange::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_currentLocalTemperature; + if (cppValue.currentLocalTemperature.IsNull()) + { + value_currentLocalTemperature = nullptr; + } + else + { + std::string value_currentLocalTemperatureClassName = "java/lang/Integer"; + std::string value_currentLocalTemperatureCtorSignature = "(I)V"; + jint jnivalue_currentLocalTemperature = static_cast(cppValue.currentLocalTemperature.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_currentLocalTemperatureClassName.c_str(), value_currentLocalTemperatureCtorSignature.c_str(), + jnivalue_currentLocalTemperature, value_currentLocalTemperature); + } + + jclass localTemperatureChangeStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$ThermostatClusterLocalTemperatureChangeEvent", + localTemperatureChangeStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$ThermostatClusterLocalTemperatureChangeEvent"); + return nullptr; + } + + jmethodID localTemperatureChangeStructCtor; + err = chip::JniReferences::GetInstance().FindMethod(env, localTemperatureChangeStructClass, "", + "(Ljava/lang/Integer;)V", &localTemperatureChangeStructCtor); + if (err != CHIP_NO_ERROR || localTemperatureChangeStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$ThermostatClusterLocalTemperatureChangeEvent constructor"); + return nullptr; + } + + jobject value = + env->NewObject(localTemperatureChangeStructClass, localTemperatureChangeStructCtor, value_currentLocalTemperature); + + return value; + } + case Events::OccupancyChange::Id: { + Events::OccupancyChange::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_previousOccupancy; + if (!cppValue.previousOccupancy.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_previousOccupancy); + } + else + { + jobject value_previousOccupancyInsideOptional; + std::string value_previousOccupancyInsideOptionalClassName = "java/lang/Integer"; + std::string value_previousOccupancyInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_previousOccupancyInsideOptional = static_cast(cppValue.previousOccupancy.Value().Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_previousOccupancyInsideOptionalClassName.c_str(), + value_previousOccupancyInsideOptionalCtorSignature.c_str(), jnivalue_previousOccupancyInsideOptional, + value_previousOccupancyInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_previousOccupancyInsideOptional, value_previousOccupancy); + } + + jobject value_currentOccupancy; + std::string value_currentOccupancyClassName = "java/lang/Integer"; + std::string value_currentOccupancyCtorSignature = "(I)V"; + jint jnivalue_currentOccupancy = static_cast(cppValue.currentOccupancy.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject(value_currentOccupancyClassName.c_str(), + value_currentOccupancyCtorSignature.c_str(), + jnivalue_currentOccupancy, value_currentOccupancy); + + jclass occupancyChangeStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$ThermostatClusterOccupancyChangeEvent", occupancyChangeStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$ThermostatClusterOccupancyChangeEvent"); + return nullptr; + } + + jmethodID occupancyChangeStructCtor; + err = chip::JniReferences::GetInstance().FindMethod(env, occupancyChangeStructClass, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &occupancyChangeStructCtor); + if (err != CHIP_NO_ERROR || occupancyChangeStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$ThermostatClusterOccupancyChangeEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(occupancyChangeStructClass, occupancyChangeStructCtor, value_previousOccupancy, + value_currentOccupancy); + + return value; + } + case Events::SetpointChange::Id: { + Events::SetpointChange::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_systemMode; + std::string value_systemModeClassName = "java/lang/Integer"; + std::string value_systemModeCtorSignature = "(I)V"; + jint jnivalue_systemMode = static_cast(cppValue.systemMode); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_systemModeClassName.c_str(), value_systemModeCtorSignature.c_str(), jnivalue_systemMode, value_systemMode); + + jobject value_occupancy; + if (!cppValue.occupancy.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_occupancy); + } + else + { + jobject value_occupancyInsideOptional; + std::string value_occupancyInsideOptionalClassName = "java/lang/Integer"; + std::string value_occupancyInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_occupancyInsideOptional = static_cast(cppValue.occupancy.Value().Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_occupancyInsideOptionalClassName.c_str(), value_occupancyInsideOptionalCtorSignature.c_str(), + jnivalue_occupancyInsideOptional, value_occupancyInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_occupancyInsideOptional, value_occupancy); + } + + jobject value_previousSetpoint; + if (!cppValue.previousSetpoint.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_previousSetpoint); + } + else + { + jobject value_previousSetpointInsideOptional; + std::string value_previousSetpointInsideOptionalClassName = "java/lang/Integer"; + std::string value_previousSetpointInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_previousSetpointInsideOptional = static_cast(cppValue.previousSetpoint.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_previousSetpointInsideOptionalClassName.c_str(), + value_previousSetpointInsideOptionalCtorSignature.c_str(), jnivalue_previousSetpointInsideOptional, + value_previousSetpointInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_previousSetpointInsideOptional, value_previousSetpoint); + } + + jobject value_currentSetpoint; + std::string value_currentSetpointClassName = "java/lang/Integer"; + std::string value_currentSetpointCtorSignature = "(I)V"; + jint jnivalue_currentSetpoint = static_cast(cppValue.currentSetpoint); + chip::JniReferences::GetInstance().CreateBoxedObject(value_currentSetpointClassName.c_str(), + value_currentSetpointCtorSignature.c_str(), + jnivalue_currentSetpoint, value_currentSetpoint); + + jclass setpointChangeStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$ThermostatClusterSetpointChangeEvent", setpointChangeStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$ThermostatClusterSetpointChangeEvent"); + return nullptr; + } + + jmethodID setpointChangeStructCtor; + err = chip::JniReferences::GetInstance().FindMethod( + env, setpointChangeStructClass, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Integer;)V", &setpointChangeStructCtor); + if (err != CHIP_NO_ERROR || setpointChangeStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$ThermostatClusterSetpointChangeEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(setpointChangeStructClass, setpointChangeStructCtor, value_systemMode, value_occupancy, + value_previousSetpoint, value_currentSetpoint); + + return value; + } + case Events::RunningStateChange::Id: { + Events::RunningStateChange::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_previousRunningState; + if (!cppValue.previousRunningState.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_previousRunningState); + } + else + { + jobject value_previousRunningStateInsideOptional; + std::string value_previousRunningStateInsideOptionalClassName = "java/lang/Integer"; + std::string value_previousRunningStateInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_previousRunningStateInsideOptional = static_cast(cppValue.previousRunningState.Value().Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_previousRunningStateInsideOptionalClassName.c_str(), + value_previousRunningStateInsideOptionalCtorSignature.c_str(), jnivalue_previousRunningStateInsideOptional, + value_previousRunningStateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_previousRunningStateInsideOptional, + value_previousRunningState); + } + + jobject value_currentRunningState; + std::string value_currentRunningStateClassName = "java/lang/Integer"; + std::string value_currentRunningStateCtorSignature = "(I)V"; + jint jnivalue_currentRunningState = static_cast(cppValue.currentRunningState.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject(value_currentRunningStateClassName.c_str(), + value_currentRunningStateCtorSignature.c_str(), + jnivalue_currentRunningState, value_currentRunningState); + + jclass runningStateChangeStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$ThermostatClusterRunningStateChangeEvent", + runningStateChangeStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$ThermostatClusterRunningStateChangeEvent"); + return nullptr; + } + + jmethodID runningStateChangeStructCtor; + err = chip::JniReferences::GetInstance().FindMethod(env, runningStateChangeStructClass, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &runningStateChangeStructCtor); + if (err != CHIP_NO_ERROR || runningStateChangeStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$ThermostatClusterRunningStateChangeEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(runningStateChangeStructClass, runningStateChangeStructCtor, value_previousRunningState, + value_currentRunningState); + + return value; + } + case Events::RunningModeChange::Id: { + Events::RunningModeChange::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_previousRunningMode; + if (!cppValue.previousRunningMode.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_previousRunningMode); + } + else + { + jobject value_previousRunningModeInsideOptional; + std::string value_previousRunningModeInsideOptionalClassName = "java/lang/Integer"; + std::string value_previousRunningModeInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_previousRunningModeInsideOptional = static_cast(cppValue.previousRunningMode.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_previousRunningModeInsideOptionalClassName.c_str(), + value_previousRunningModeInsideOptionalCtorSignature.c_str(), jnivalue_previousRunningModeInsideOptional, + value_previousRunningModeInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_previousRunningModeInsideOptional, + value_previousRunningMode); + } + + jobject value_currentRunningMode; + std::string value_currentRunningModeClassName = "java/lang/Integer"; + std::string value_currentRunningModeCtorSignature = "(I)V"; + jint jnivalue_currentRunningMode = static_cast(cppValue.currentRunningMode); + chip::JniReferences::GetInstance().CreateBoxedObject(value_currentRunningModeClassName.c_str(), + value_currentRunningModeCtorSignature.c_str(), + jnivalue_currentRunningMode, value_currentRunningMode); + + jclass runningModeChangeStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$ThermostatClusterRunningModeChangeEvent", + runningModeChangeStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$ThermostatClusterRunningModeChangeEvent"); + return nullptr; + } + + jmethodID runningModeChangeStructCtor; + err = chip::JniReferences::GetInstance().FindMethod(env, runningModeChangeStructClass, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &runningModeChangeStructCtor); + if (err != CHIP_NO_ERROR || runningModeChangeStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$ThermostatClusterRunningModeChangeEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(runningModeChangeStructClass, runningModeChangeStructCtor, value_previousRunningMode, + value_currentRunningMode); + + return value; + } + case Events::ActiveScheduleChange::Id: { + Events::ActiveScheduleChange::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_previousScheduleHandle; + if (!cppValue.previousScheduleHandle.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_previousScheduleHandle); + } + else + { + jobject value_previousScheduleHandleInsideOptional; + if (cppValue.previousScheduleHandle.Value().IsNull()) + { + value_previousScheduleHandleInsideOptional = nullptr; + } + else + { + jbyteArray value_previousScheduleHandleInsideOptionalByteArray = + env->NewByteArray(static_cast(cppValue.previousScheduleHandle.Value().Value().size())); + env->SetByteArrayRegion( + value_previousScheduleHandleInsideOptionalByteArray, 0, + static_cast(cppValue.previousScheduleHandle.Value().Value().size()), + reinterpret_cast(cppValue.previousScheduleHandle.Value().Value().data())); + value_previousScheduleHandleInsideOptional = value_previousScheduleHandleInsideOptionalByteArray; + } + chip::JniReferences::GetInstance().CreateOptional(value_previousScheduleHandleInsideOptional, + value_previousScheduleHandle); + } + + jobject value_currentScheduleHandle; + if (cppValue.currentScheduleHandle.IsNull()) + { + value_currentScheduleHandle = nullptr; + } + else + { + jbyteArray value_currentScheduleHandleByteArray = + env->NewByteArray(static_cast(cppValue.currentScheduleHandle.Value().size())); + env->SetByteArrayRegion(value_currentScheduleHandleByteArray, 0, + static_cast(cppValue.currentScheduleHandle.Value().size()), + reinterpret_cast(cppValue.currentScheduleHandle.Value().data())); + value_currentScheduleHandle = value_currentScheduleHandleByteArray; + } + + jclass activeScheduleChangeStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$ThermostatClusterActiveScheduleChangeEvent", + activeScheduleChangeStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$ThermostatClusterActiveScheduleChangeEvent"); + return nullptr; + } + + jmethodID activeScheduleChangeStructCtor; + err = chip::JniReferences::GetInstance().FindMethod(env, activeScheduleChangeStructClass, "", + "(Ljava/util/Optional;[B)V", &activeScheduleChangeStructCtor); + if (err != CHIP_NO_ERROR || activeScheduleChangeStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$ThermostatClusterActiveScheduleChangeEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(activeScheduleChangeStructClass, activeScheduleChangeStructCtor, + value_previousScheduleHandle, value_currentScheduleHandle); + + return value; + } + case Events::ActivePresetChange::Id: { + Events::ActivePresetChange::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_previousPresetHandle; + if (!cppValue.previousPresetHandle.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_previousPresetHandle); + } + else + { + jobject value_previousPresetHandleInsideOptional; + if (cppValue.previousPresetHandle.Value().IsNull()) + { + value_previousPresetHandleInsideOptional = nullptr; + } + else + { + jbyteArray value_previousPresetHandleInsideOptionalByteArray = + env->NewByteArray(static_cast(cppValue.previousPresetHandle.Value().Value().size())); + env->SetByteArrayRegion(value_previousPresetHandleInsideOptionalByteArray, 0, + static_cast(cppValue.previousPresetHandle.Value().Value().size()), + reinterpret_cast(cppValue.previousPresetHandle.Value().Value().data())); + value_previousPresetHandleInsideOptional = value_previousPresetHandleInsideOptionalByteArray; + } + chip::JniReferences::GetInstance().CreateOptional(value_previousPresetHandleInsideOptional, + value_previousPresetHandle); + } + + jobject value_currentPresetHandle; + if (cppValue.currentPresetHandle.IsNull()) + { + value_currentPresetHandle = nullptr; + } + else + { + jbyteArray value_currentPresetHandleByteArray = + env->NewByteArray(static_cast(cppValue.currentPresetHandle.Value().size())); + env->SetByteArrayRegion(value_currentPresetHandleByteArray, 0, + static_cast(cppValue.currentPresetHandle.Value().size()), + reinterpret_cast(cppValue.currentPresetHandle.Value().data())); + value_currentPresetHandle = value_currentPresetHandleByteArray; + } + + jclass activePresetChangeStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$ThermostatClusterActivePresetChangeEvent", + activePresetChangeStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$ThermostatClusterActivePresetChangeEvent"); + return nullptr; + } + + jmethodID activePresetChangeStructCtor; + err = chip::JniReferences::GetInstance().FindMethod(env, activePresetChangeStructClass, "", + "(Ljava/util/Optional;[B)V", &activePresetChangeStructCtor); + if (err != CHIP_NO_ERROR || activePresetChangeStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$ThermostatClusterActivePresetChangeEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(activePresetChangeStructClass, activePresetChangeStructCtor, value_previousPresetHandle, + value_currentPresetHandle); + + return value; + } default: *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index ea916300b029de..e966cd8a0200b3 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -31279,6 +31279,7 @@ class Feature(IntFlag): kLocalTemperatureNotExposed = 0x40 kMatterScheduleConfiguration = 0x80 kPresets = 0x100 + kEvents = 0x200 class HVACSystemTypeBitmap(IntFlag): kCoolingStage = 0x3 @@ -32648,6 +32649,177 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: uint = 0 + class Events: + @dataclass + class SystemModeChange(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="previousSystemMode", Tag=0, Type=typing.Optional[Thermostat.Enums.SystemModeEnum]), + ClusterObjectFieldDescriptor(Label="currentSystemMode", Tag=1, Type=Thermostat.Enums.SystemModeEnum), + ]) + + previousSystemMode: typing.Optional[Thermostat.Enums.SystemModeEnum] = None + currentSystemMode: Thermostat.Enums.SystemModeEnum = 0 + + @dataclass + class LocalTemperatureChange(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="currentLocalTemperature", Tag=0, Type=typing.Union[Nullable, int]), + ]) + + currentLocalTemperature: typing.Union[Nullable, int] = NullValue + + @dataclass + class OccupancyChange(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="previousOccupancy", Tag=0, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="currentOccupancy", Tag=1, Type=uint), + ]) + + previousOccupancy: typing.Optional[uint] = None + currentOccupancy: uint = 0 + + @dataclass + class SetpointChange(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="systemMode", Tag=0, Type=Thermostat.Enums.SystemModeEnum), + ClusterObjectFieldDescriptor(Label="occupancy", Tag=1, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="previousSetpoint", Tag=2, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="currentSetpoint", Tag=3, Type=int), + ]) + + systemMode: Thermostat.Enums.SystemModeEnum = 0 + occupancy: typing.Optional[uint] = None + previousSetpoint: typing.Optional[int] = None + currentSetpoint: int = 0 + + @dataclass + class RunningStateChange(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="previousRunningState", Tag=0, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="currentRunningState", Tag=1, Type=uint), + ]) + + previousRunningState: typing.Optional[uint] = None + currentRunningState: uint = 0 + + @dataclass + class RunningModeChange(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="previousRunningMode", Tag=0, Type=typing.Optional[Thermostat.Enums.ThermostatRunningModeEnum]), + ClusterObjectFieldDescriptor(Label="currentRunningMode", Tag=1, Type=Thermostat.Enums.ThermostatRunningModeEnum), + ]) + + previousRunningMode: typing.Optional[Thermostat.Enums.ThermostatRunningModeEnum] = None + currentRunningMode: Thermostat.Enums.ThermostatRunningModeEnum = 0 + + @dataclass + class ActiveScheduleChange(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000006 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="previousScheduleHandle", Tag=0, Type=typing.Union[None, Nullable, bytes]), + ClusterObjectFieldDescriptor(Label="currentScheduleHandle", Tag=1, Type=typing.Union[Nullable, bytes]), + ]) + + previousScheduleHandle: typing.Union[None, Nullable, bytes] = None + currentScheduleHandle: typing.Union[Nullable, bytes] = NullValue + + @dataclass + class ActivePresetChange(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000007 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="previousPresetHandle", Tag=0, Type=typing.Union[None, Nullable, bytes]), + ClusterObjectFieldDescriptor(Label="currentPresetHandle", Tag=1, Type=typing.Union[Nullable, bytes]), + ]) + + previousPresetHandle: typing.Union[None, Nullable, bytes] = None + currentPresetHandle: typing.Union[Nullable, bytes] = NullValue + @dataclass class FanControl(Cluster): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index d75cd55b375c32..d3116ef2afdfb3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -19486,6 +19486,7 @@ typedef NS_OPTIONS(uint32_t, MTRThermostatFeature) { MTRThermostatFeatureLocalTemperatureNotExposed MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) = 0x40, MTRThermostatFeatureMatterScheduleConfiguration MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) = 0x80, MTRThermostatFeaturePresets MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) = 0x100, + MTRThermostatFeatureEvents MTR_PROVISIONALLY_AVAILABLE = 0x200, } MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_OPTIONS(uint8_t, MTRThermostatHVACSystemTypeBitmap) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 9c64027af3ada6..ea41f51b44070c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -7592,6 +7592,18 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { MTREventIDTypeClusterPumpConfigurationAndControlEventAirDetectionID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000000F, MTREventIDTypeClusterPumpConfigurationAndControlEventTurbineOperationID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000010, + // Cluster Thermostat deprecated event names + + // Cluster Thermostat events + MTREventIDTypeClusterThermostatEventSystemModeChangeID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTREventIDTypeClusterThermostatEventLocalTemperatureChangeID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTREventIDTypeClusterThermostatEventOccupancyChangeID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTREventIDTypeClusterThermostatEventSetpointChangeID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTREventIDTypeClusterThermostatEventRunningStateChangeID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTREventIDTypeClusterThermostatEventRunningModeChangeID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + MTREventIDTypeClusterThermostatEventActiveScheduleChangeID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, + MTREventIDTypeClusterThermostatEventActivePresetChangeID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, + // Cluster OccupancySensing deprecated event names // Cluster OccupancySensing events diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 9ebe0fbc8e8a8c..cc55b4189db3f6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -14364,6 +14364,39 @@ switch (eventID) { + // Cluster Thermostat events + case MTREventIDTypeClusterThermostatEventSystemModeChangeID: + result = @"SystemModeChange"; + break; + + case MTREventIDTypeClusterThermostatEventLocalTemperatureChangeID: + result = @"LocalTemperatureChange"; + break; + + case MTREventIDTypeClusterThermostatEventOccupancyChangeID: + result = @"OccupancyChange"; + break; + + case MTREventIDTypeClusterThermostatEventSetpointChangeID: + result = @"SetpointChange"; + break; + + case MTREventIDTypeClusterThermostatEventRunningStateChangeID: + result = @"RunningStateChange"; + break; + + case MTREventIDTypeClusterThermostatEventRunningModeChangeID: + result = @"RunningModeChange"; + break; + + case MTREventIDTypeClusterThermostatEventActiveScheduleChangeID: + result = @"ActiveScheduleChange"; + break; + + case MTREventIDTypeClusterThermostatEventActivePresetChangeID: + result = @"ActivePresetChange"; + break; + default: result = [NSString stringWithFormat:@"", eventID]; break; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index e6b4ca1917dc17..f98d3dc2757355 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -3938,6 +3938,239 @@ static id _Nullable DecodeEventPayloadForThermostatCluster(EventId aEventId, TLV { using namespace Clusters::Thermostat; switch (aEventId) { + case Events::SystemModeChange::Id: { + Events::SystemModeChange::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRThermostatClusterSystemModeChangeEvent new]; + + do { + NSNumber * _Nullable memberValue; + if (cppValue.previousSystemMode.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.previousSystemMode.Value())]; + } else { + memberValue = nil; + } + value.previousSystemMode = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.currentSystemMode)]; + value.currentSystemMode = memberValue; + } while (0); + + return value; + } + case Events::LocalTemperatureChange::Id: { + Events::LocalTemperatureChange::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRThermostatClusterLocalTemperatureChangeEvent new]; + + do { + NSNumber * _Nullable memberValue; + if (cppValue.currentLocalTemperature.IsNull()) { + memberValue = nil; + } else { + memberValue = [NSNumber numberWithShort:cppValue.currentLocalTemperature.Value()]; + } + value.currentLocalTemperature = memberValue; + } while (0); + + return value; + } + case Events::OccupancyChange::Id: { + Events::OccupancyChange::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRThermostatClusterOccupancyChangeEvent new]; + + do { + NSNumber * _Nullable memberValue; + if (cppValue.previousOccupancy.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:cppValue.previousOccupancy.Value().Raw()]; + } else { + memberValue = nil; + } + value.previousOccupancy = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:cppValue.currentOccupancy.Raw()]; + value.currentOccupancy = memberValue; + } while (0); + + return value; + } + case Events::SetpointChange::Id: { + Events::SetpointChange::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRThermostatClusterSetpointChangeEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.systemMode)]; + value.systemMode = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.occupancy.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:cppValue.occupancy.Value().Raw()]; + } else { + memberValue = nil; + } + value.occupancy = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.previousSetpoint.HasValue()) { + memberValue = [NSNumber numberWithShort:cppValue.previousSetpoint.Value()]; + } else { + memberValue = nil; + } + value.previousSetpoint = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithShort:cppValue.currentSetpoint]; + value.currentSetpoint = memberValue; + } while (0); + + return value; + } + case Events::RunningStateChange::Id: { + Events::RunningStateChange::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRThermostatClusterRunningStateChangeEvent new]; + + do { + NSNumber * _Nullable memberValue; + if (cppValue.previousRunningState.HasValue()) { + memberValue = [NSNumber numberWithUnsignedShort:cppValue.previousRunningState.Value().Raw()]; + } else { + memberValue = nil; + } + value.previousRunningState = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedShort:cppValue.currentRunningState.Raw()]; + value.currentRunningState = memberValue; + } while (0); + + return value; + } + case Events::RunningModeChange::Id: { + Events::RunningModeChange::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRThermostatClusterRunningModeChangeEvent new]; + + do { + NSNumber * _Nullable memberValue; + if (cppValue.previousRunningMode.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.previousRunningMode.Value())]; + } else { + memberValue = nil; + } + value.previousRunningMode = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.currentRunningMode)]; + value.currentRunningMode = memberValue; + } while (0); + + return value; + } + case Events::ActiveScheduleChange::Id: { + Events::ActiveScheduleChange::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRThermostatClusterActiveScheduleChangeEvent new]; + + do { + NSData * _Nullable memberValue; + if (cppValue.previousScheduleHandle.HasValue()) { + if (cppValue.previousScheduleHandle.Value().IsNull()) { + memberValue = nil; + } else { + memberValue = AsData(cppValue.previousScheduleHandle.Value().Value()); + } + } else { + memberValue = nil; + } + value.previousScheduleHandle = memberValue; + } while (0); + do { + NSData * _Nullable memberValue; + if (cppValue.currentScheduleHandle.IsNull()) { + memberValue = nil; + } else { + memberValue = AsData(cppValue.currentScheduleHandle.Value()); + } + value.currentScheduleHandle = memberValue; + } while (0); + + return value; + } + case Events::ActivePresetChange::Id: { + Events::ActivePresetChange::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRThermostatClusterActivePresetChangeEvent new]; + + do { + NSData * _Nullable memberValue; + if (cppValue.previousPresetHandle.HasValue()) { + if (cppValue.previousPresetHandle.Value().IsNull()) { + memberValue = nil; + } else { + memberValue = AsData(cppValue.previousPresetHandle.Value().Value()); + } + } else { + memberValue = nil; + } + value.previousPresetHandle = memberValue; + } while (0); + do { + NSData * _Nullable memberValue; + if (cppValue.currentPresetHandle.IsNull()) { + memberValue = nil; + } else { + memberValue = AsData(cppValue.currentPresetHandle.Value()); + } + value.currentPresetHandle = memberValue; + } while (0); + + return value; + } default: { break; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 894bb613837324..23eb8a2eacfc63 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1783,6 +1783,55 @@ MTR_DEPRECATED("Please use MTRThermostatClusterWeeklyScheduleTransitionStruct", @property (nonatomic, copy) NSNumber * _Nullable coolSetpoint MTR_DEPRECATED("Please use MTRThermostatClusterWeeklyScheduleTransitionStruct", ios(16.1, 17.4), macos(13.0, 14.4), watchos(9.1, 10.4), tvos(16.1, 17.4)); @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterSystemModeChangeEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nullable previousSystemMode MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull currentSystemMode MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterLocalTemperatureChangeEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nullable currentLocalTemperature MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterOccupancyChangeEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nullable previousOccupancy MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull currentOccupancy MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterSetpointChangeEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull systemMode MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable occupancy MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable previousSetpoint MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull currentSetpoint MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterRunningStateChangeEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nullable previousRunningState MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull currentRunningState MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterRunningModeChangeEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nullable previousRunningMode MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull currentRunningMode MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterActiveScheduleChangeEvent : NSObject +@property (nonatomic, copy) NSData * _Nullable previousScheduleHandle MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSData * _Nullable currentScheduleHandle MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterActivePresetChangeEvent : NSObject +@property (nonatomic, copy) NSData * _Nullable previousPresetHandle MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSData * _Nullable currentPresetHandle MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) @interface MTROccupancySensingClusterHoldTimeLimitsStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull holdTimeMin MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 353e29b75da71f..3e3f8be074ec7c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -7561,6 +7561,249 @@ @implementation MTRThermostatClusterThermostatScheduleTransition : MTRThermostat @dynamic coolSetpoint; @end +@implementation MTRThermostatClusterSystemModeChangeEvent +- (instancetype)init +{ + if (self = [super init]) { + + _previousSystemMode = nil; + + _currentSystemMode = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRThermostatClusterSystemModeChangeEvent alloc] init]; + + other.previousSystemMode = self.previousSystemMode; + other.currentSystemMode = self.currentSystemMode; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: previousSystemMode:%@; currentSystemMode:%@; >", NSStringFromClass([self class]), _previousSystemMode, _currentSystemMode]; + return descriptionString; +} + +@end + +@implementation MTRThermostatClusterLocalTemperatureChangeEvent +- (instancetype)init +{ + if (self = [super init]) { + + _currentLocalTemperature = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRThermostatClusterLocalTemperatureChangeEvent alloc] init]; + + other.currentLocalTemperature = self.currentLocalTemperature; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: currentLocalTemperature:%@; >", NSStringFromClass([self class]), _currentLocalTemperature]; + return descriptionString; +} + +@end + +@implementation MTRThermostatClusterOccupancyChangeEvent +- (instancetype)init +{ + if (self = [super init]) { + + _previousOccupancy = nil; + + _currentOccupancy = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRThermostatClusterOccupancyChangeEvent alloc] init]; + + other.previousOccupancy = self.previousOccupancy; + other.currentOccupancy = self.currentOccupancy; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: previousOccupancy:%@; currentOccupancy:%@; >", NSStringFromClass([self class]), _previousOccupancy, _currentOccupancy]; + return descriptionString; +} + +@end + +@implementation MTRThermostatClusterSetpointChangeEvent +- (instancetype)init +{ + if (self = [super init]) { + + _systemMode = @(0); + + _occupancy = nil; + + _previousSetpoint = nil; + + _currentSetpoint = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRThermostatClusterSetpointChangeEvent alloc] init]; + + other.systemMode = self.systemMode; + other.occupancy = self.occupancy; + other.previousSetpoint = self.previousSetpoint; + other.currentSetpoint = self.currentSetpoint; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: systemMode:%@; occupancy:%@; previousSetpoint:%@; currentSetpoint:%@; >", NSStringFromClass([self class]), _systemMode, _occupancy, _previousSetpoint, _currentSetpoint]; + return descriptionString; +} + +@end + +@implementation MTRThermostatClusterRunningStateChangeEvent +- (instancetype)init +{ + if (self = [super init]) { + + _previousRunningState = nil; + + _currentRunningState = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRThermostatClusterRunningStateChangeEvent alloc] init]; + + other.previousRunningState = self.previousRunningState; + other.currentRunningState = self.currentRunningState; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: previousRunningState:%@; currentRunningState:%@; >", NSStringFromClass([self class]), _previousRunningState, _currentRunningState]; + return descriptionString; +} + +@end + +@implementation MTRThermostatClusterRunningModeChangeEvent +- (instancetype)init +{ + if (self = [super init]) { + + _previousRunningMode = nil; + + _currentRunningMode = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRThermostatClusterRunningModeChangeEvent alloc] init]; + + other.previousRunningMode = self.previousRunningMode; + other.currentRunningMode = self.currentRunningMode; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: previousRunningMode:%@; currentRunningMode:%@; >", NSStringFromClass([self class]), _previousRunningMode, _currentRunningMode]; + return descriptionString; +} + +@end + +@implementation MTRThermostatClusterActiveScheduleChangeEvent +- (instancetype)init +{ + if (self = [super init]) { + + _previousScheduleHandle = nil; + + _currentScheduleHandle = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRThermostatClusterActiveScheduleChangeEvent alloc] init]; + + other.previousScheduleHandle = self.previousScheduleHandle; + other.currentScheduleHandle = self.currentScheduleHandle; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: previousScheduleHandle:%@; currentScheduleHandle:%@; >", NSStringFromClass([self class]), [_previousScheduleHandle base64EncodedStringWithOptions:0], [_currentScheduleHandle base64EncodedStringWithOptions:0]]; + return descriptionString; +} + +@end + +@implementation MTRThermostatClusterActivePresetChangeEvent +- (instancetype)init +{ + if (self = [super init]) { + + _previousPresetHandle = nil; + + _currentPresetHandle = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRThermostatClusterActivePresetChangeEvent alloc] init]; + + other.previousPresetHandle = self.previousPresetHandle; + other.currentPresetHandle = self.currentPresetHandle; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: previousPresetHandle:%@; currentPresetHandle:%@; >", NSStringFromClass([self class]), [_previousPresetHandle base64EncodedStringWithOptions:0], [_currentPresetHandle base64EncodedStringWithOptions:0]]; + return descriptionString; +} + +@end + @implementation MTROccupancySensingClusterHoldTimeLimitsStruct - (instancetype)init { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 06e421bd4bf2d9..24dccb0d709d2b 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -4442,6 +4442,7 @@ enum class Feature : uint32_t kLocalTemperatureNotExposed = 0x40, kMatterScheduleConfiguration = 0x80, kPresets = 0x100, + kEvents = 0x200, }; // Bitmap for HVACSystemTypeBitmap diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 9b0c35f5f3fb53..3888129cd0705c 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -22350,7 +22350,333 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre } } // namespace Attributes -namespace Events {} // namespace Events +namespace Events { +namespace SystemModeChange { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kPreviousSystemMode), previousSystemMode)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCurrentSystemMode), currentSystemMode)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kPreviousSystemMode)) + { + err = DataModel::Decode(reader, previousSystemMode); + } + else if (__context_tag == to_underlying(Fields::kCurrentSystemMode)) + { + err = DataModel::Decode(reader, currentSystemMode); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SystemModeChange. +namespace LocalTemperatureChange { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCurrentLocalTemperature), currentLocalTemperature)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kCurrentLocalTemperature)) + { + err = DataModel::Decode(reader, currentLocalTemperature); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace LocalTemperatureChange. +namespace OccupancyChange { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kPreviousOccupancy), previousOccupancy)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCurrentOccupancy), currentOccupancy)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kPreviousOccupancy)) + { + err = DataModel::Decode(reader, previousOccupancy); + } + else if (__context_tag == to_underlying(Fields::kCurrentOccupancy)) + { + err = DataModel::Decode(reader, currentOccupancy); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace OccupancyChange. +namespace SetpointChange { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kSystemMode), systemMode)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kOccupancy), occupancy)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kPreviousSetpoint), previousSetpoint)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCurrentSetpoint), currentSetpoint)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kSystemMode)) + { + err = DataModel::Decode(reader, systemMode); + } + else if (__context_tag == to_underlying(Fields::kOccupancy)) + { + err = DataModel::Decode(reader, occupancy); + } + else if (__context_tag == to_underlying(Fields::kPreviousSetpoint)) + { + err = DataModel::Decode(reader, previousSetpoint); + } + else if (__context_tag == to_underlying(Fields::kCurrentSetpoint)) + { + err = DataModel::Decode(reader, currentSetpoint); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetpointChange. +namespace RunningStateChange { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kPreviousRunningState), previousRunningState)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCurrentRunningState), currentRunningState)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kPreviousRunningState)) + { + err = DataModel::Decode(reader, previousRunningState); + } + else if (__context_tag == to_underlying(Fields::kCurrentRunningState)) + { + err = DataModel::Decode(reader, currentRunningState); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace RunningStateChange. +namespace RunningModeChange { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kPreviousRunningMode), previousRunningMode)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCurrentRunningMode), currentRunningMode)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kPreviousRunningMode)) + { + err = DataModel::Decode(reader, previousRunningMode); + } + else if (__context_tag == to_underlying(Fields::kCurrentRunningMode)) + { + err = DataModel::Decode(reader, currentRunningMode); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace RunningModeChange. +namespace ActiveScheduleChange { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kPreviousScheduleHandle), previousScheduleHandle)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCurrentScheduleHandle), currentScheduleHandle)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kPreviousScheduleHandle)) + { + err = DataModel::Decode(reader, previousScheduleHandle); + } + else if (__context_tag == to_underlying(Fields::kCurrentScheduleHandle)) + { + err = DataModel::Decode(reader, currentScheduleHandle); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ActiveScheduleChange. +namespace ActivePresetChange { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kPreviousPresetHandle), previousPresetHandle)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kCurrentPresetHandle), currentPresetHandle)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kPreviousPresetHandle)) + { + err = DataModel::Decode(reader, previousPresetHandle); + } + else if (__context_tag == to_underlying(Fields::kCurrentPresetHandle)) + { + err = DataModel::Decode(reader, currentPresetHandle); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ActivePresetChange. +} // namespace Events } // namespace Thermostat namespace FanControl { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index af9e1129f9d449..26f72536c7be91 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -30585,6 +30585,299 @@ struct TypeInfo }; }; } // namespace Attributes +namespace Events { +namespace SystemModeChange { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kPreviousSystemMode = 0, + kCurrentSystemMode = 1, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::SystemModeChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr bool kIsFabricScoped = false; + + Optional previousSystemMode; + SystemModeEnum currentSystemMode = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::SystemModeChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + + Optional previousSystemMode; + SystemModeEnum currentSystemMode = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace SystemModeChange +namespace LocalTemperatureChange { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kCurrentLocalTemperature = 0, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::LocalTemperatureChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr bool kIsFabricScoped = false; + + DataModel::Nullable currentLocalTemperature; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::LocalTemperatureChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + + DataModel::Nullable currentLocalTemperature; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace LocalTemperatureChange +namespace OccupancyChange { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kPreviousOccupancy = 0, + kCurrentOccupancy = 1, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::OccupancyChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr bool kIsFabricScoped = false; + + Optional> previousOccupancy; + chip::BitMask currentOccupancy = static_cast>(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::OccupancyChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + + Optional> previousOccupancy; + chip::BitMask currentOccupancy = static_cast>(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace OccupancyChange +namespace SetpointChange { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kSystemMode = 0, + kOccupancy = 1, + kPreviousSetpoint = 2, + kCurrentSetpoint = 3, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::SetpointChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr bool kIsFabricScoped = false; + + SystemModeEnum systemMode = static_cast(0); + Optional> occupancy; + Optional previousSetpoint; + int16_t currentSetpoint = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::SetpointChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + + SystemModeEnum systemMode = static_cast(0); + Optional> occupancy; + Optional previousSetpoint; + int16_t currentSetpoint = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace SetpointChange +namespace RunningStateChange { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kPreviousRunningState = 0, + kCurrentRunningState = 1, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::RunningStateChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr bool kIsFabricScoped = false; + + Optional> previousRunningState; + chip::BitMask currentRunningState = static_cast>(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::RunningStateChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + + Optional> previousRunningState; + chip::BitMask currentRunningState = static_cast>(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace RunningStateChange +namespace RunningModeChange { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kPreviousRunningMode = 0, + kCurrentRunningMode = 1, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::RunningModeChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr bool kIsFabricScoped = false; + + Optional previousRunningMode; + ThermostatRunningModeEnum currentRunningMode = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::RunningModeChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + + Optional previousRunningMode; + ThermostatRunningModeEnum currentRunningMode = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace RunningModeChange +namespace ActiveScheduleChange { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kPreviousScheduleHandle = 0, + kCurrentScheduleHandle = 1, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::ActiveScheduleChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr bool kIsFabricScoped = false; + + Optional> previousScheduleHandle; + DataModel::Nullable currentScheduleHandle; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::ActiveScheduleChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + + Optional> previousScheduleHandle; + DataModel::Nullable currentScheduleHandle; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace ActiveScheduleChange +namespace ActivePresetChange { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kPreviousPresetHandle = 0, + kCurrentPresetHandle = 1, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::ActivePresetChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr bool kIsFabricScoped = false; + + Optional> previousPresetHandle; + DataModel::Nullable currentPresetHandle; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::ActivePresetChange::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + + Optional> previousPresetHandle; + DataModel::Nullable currentPresetHandle; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace ActivePresetChange +} // namespace Events } // namespace Thermostat namespace FanControl { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h index 8cc6d0e02a0636..003368710524f8 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h @@ -633,6 +633,44 @@ static constexpr EventId Id = 0x00000010; } // namespace Events } // namespace PumpConfigurationAndControl +namespace Thermostat { +namespace Events { + +namespace SystemModeChange { +static constexpr EventId Id = 0x00000000; +} // namespace SystemModeChange + +namespace LocalTemperatureChange { +static constexpr EventId Id = 0x00000001; +} // namespace LocalTemperatureChange + +namespace OccupancyChange { +static constexpr EventId Id = 0x00000002; +} // namespace OccupancyChange + +namespace SetpointChange { +static constexpr EventId Id = 0x00000003; +} // namespace SetpointChange + +namespace RunningStateChange { +static constexpr EventId Id = 0x00000004; +} // namespace RunningStateChange + +namespace RunningModeChange { +static constexpr EventId Id = 0x00000005; +} // namespace RunningModeChange + +namespace ActiveScheduleChange { +static constexpr EventId Id = 0x00000006; +} // namespace ActiveScheduleChange + +namespace ActivePresetChange { +static constexpr EventId Id = 0x00000007; +} // namespace ActivePresetChange + +} // namespace Events +} // namespace Thermostat + namespace OccupancySensing { namespace Events { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index a37faf7f65bf87..1661108e03ba8a 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -9670,6 +9670,14 @@ class ServiceAreaSkipArea : public ClusterCommand | * ClusterRevision | 0xFFFD | |------------------------------------------------------------------------------| | Events: | | +| * SystemModeChange | 0x0000 | +| * LocalTemperatureChange | 0x0001 | +| * OccupancyChange | 0x0002 | +| * SetpointChange | 0x0003 | +| * RunningStateChange | 0x0004 | +| * RunningModeChange | 0x0005 | +| * ActiveScheduleChange | 0x0006 | +| * ActivePresetChange | 0x0007 | \*----------------------------------------------------------------------------*/ /* @@ -24830,8 +24838,24 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c // // Events // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "system-mode-change", Events::SystemModeChange::Id, credsIssuerConfig), // + make_unique(Id, "local-temperature-change", Events::LocalTemperatureChange::Id, credsIssuerConfig), // + make_unique(Id, "occupancy-change", Events::OccupancyChange::Id, credsIssuerConfig), // + make_unique(Id, "setpoint-change", Events::SetpointChange::Id, credsIssuerConfig), // + make_unique(Id, "running-state-change", Events::RunningStateChange::Id, credsIssuerConfig), // + make_unique(Id, "running-mode-change", Events::RunningModeChange::Id, credsIssuerConfig), // + make_unique(Id, "active-schedule-change", Events::ActiveScheduleChange::Id, credsIssuerConfig), // + make_unique(Id, "active-preset-change", Events::ActivePresetChange::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "system-mode-change", Events::SystemModeChange::Id, credsIssuerConfig), // + make_unique(Id, "local-temperature-change", Events::LocalTemperatureChange::Id, credsIssuerConfig), // + make_unique(Id, "occupancy-change", Events::OccupancyChange::Id, credsIssuerConfig), // + make_unique(Id, "setpoint-change", Events::SetpointChange::Id, credsIssuerConfig), // + make_unique(Id, "running-state-change", Events::RunningStateChange::Id, credsIssuerConfig), // + make_unique(Id, "running-mode-change", Events::RunningModeChange::Id, credsIssuerConfig), // + make_unique(Id, "active-schedule-change", Events::ActiveScheduleChange::Id, credsIssuerConfig), // + make_unique(Id, "active-preset-change", Events::ActivePresetChange::Id, credsIssuerConfig), // }; commands.RegisterCluster(clusterName, clusterCommands); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 7333e140f9742a..1446bd01de8ffd 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -9070,6 +9070,206 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const Thermostat::Events::SystemModeChange::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("PreviousSystemMode", indent + 1, value.previousSystemMode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PreviousSystemMode'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("CurrentSystemMode", indent + 1, value.currentSystemMode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CurrentSystemMode'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const Thermostat::Events::LocalTemperatureChange::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("CurrentLocalTemperature", indent + 1, value.currentLocalTemperature); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CurrentLocalTemperature'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const Thermostat::Events::OccupancyChange::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("PreviousOccupancy", indent + 1, value.previousOccupancy); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PreviousOccupancy'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("CurrentOccupancy", indent + 1, value.currentOccupancy); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CurrentOccupancy'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const Thermostat::Events::SetpointChange::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("SystemMode", indent + 1, value.systemMode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SystemMode'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Occupancy", indent + 1, value.occupancy); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Occupancy'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("PreviousSetpoint", indent + 1, value.previousSetpoint); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PreviousSetpoint'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("CurrentSetpoint", indent + 1, value.currentSetpoint); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CurrentSetpoint'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const Thermostat::Events::RunningStateChange::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("PreviousRunningState", indent + 1, value.previousRunningState); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PreviousRunningState'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("CurrentRunningState", indent + 1, value.currentRunningState); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CurrentRunningState'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const Thermostat::Events::RunningModeChange::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("PreviousRunningMode", indent + 1, value.previousRunningMode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PreviousRunningMode'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("CurrentRunningMode", indent + 1, value.currentRunningMode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CurrentRunningMode'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const Thermostat::Events::ActiveScheduleChange::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("PreviousScheduleHandle", indent + 1, value.previousScheduleHandle); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PreviousScheduleHandle'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("CurrentScheduleHandle", indent + 1, value.currentScheduleHandle); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CurrentScheduleHandle'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const Thermostat::Events::ActivePresetChange::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("PreviousPresetHandle", indent + 1, value.previousPresetHandle); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PreviousPresetHandle'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("CurrentPresetHandle", indent + 1, value.currentPresetHandle); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CurrentPresetHandle'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const OccupancySensing::Events::OccupancyChanged::DecodableType & value) { @@ -21795,6 +21995,52 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip } break; } + case Thermostat::Id: { + switch (header.mPath.mEventId) + { + case Thermostat::Events::SystemModeChange::Id: { + chip::app::Clusters::Thermostat::Events::SystemModeChange::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SystemModeChange", 1, value); + } + case Thermostat::Events::LocalTemperatureChange::Id: { + chip::app::Clusters::Thermostat::Events::LocalTemperatureChange::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LocalTemperatureChange", 1, value); + } + case Thermostat::Events::OccupancyChange::Id: { + chip::app::Clusters::Thermostat::Events::OccupancyChange::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OccupancyChange", 1, value); + } + case Thermostat::Events::SetpointChange::Id: { + chip::app::Clusters::Thermostat::Events::SetpointChange::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SetpointChange", 1, value); + } + case Thermostat::Events::RunningStateChange::Id: { + chip::app::Clusters::Thermostat::Events::RunningStateChange::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("RunningStateChange", 1, value); + } + case Thermostat::Events::RunningModeChange::Id: { + chip::app::Clusters::Thermostat::Events::RunningModeChange::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("RunningModeChange", 1, value); + } + case Thermostat::Events::ActiveScheduleChange::Id: { + chip::app::Clusters::Thermostat::Events::ActiveScheduleChange::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ActiveScheduleChange", 1, value); + } + case Thermostat::Events::ActivePresetChange::Id: { + chip::app::Clusters::Thermostat::Events::ActivePresetChange::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ActivePresetChange", 1, value); + } + } + break; + } case OccupancySensing::Id: { switch (header.mPath.mEventId) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 20c205ec11a8b8..d6fd04db436be9 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -768,6 +768,22 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::PumpConfigurationAndControl::Events::AirDetection::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::PumpConfigurationAndControl::Events::TurbineOperation::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Thermostat::Events::SystemModeChange::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Thermostat::Events::LocalTemperatureChange::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Thermostat::Events::OccupancyChange::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Thermostat::Events::SetpointChange::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Thermostat::Events::RunningStateChange::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Thermostat::Events::RunningModeChange::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Thermostat::Events::ActiveScheduleChange::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Thermostat::Events::ActivePresetChange::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OccupancySensing::Events::OccupancyChanged::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index d802bf489ab86a..189a4214f877f8 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -95977,6 +95977,14 @@ class SubscribeAttributePumpConfigurationAndControlClusterRevision : public Subs | * ClusterRevision | 0xFFFD | |------------------------------------------------------------------------------| | Events: | | +| * SystemModeChange | 0x0000 | +| * LocalTemperatureChange | 0x0001 | +| * OccupancyChange | 0x0002 | +| * SetpointChange | 0x0003 | +| * RunningStateChange | 0x0004 | +| * RunningModeChange | 0x0005 | +| * ActiveScheduleChange | 0x0006 | +| * ActivePresetChange | 0x0007 | \*----------------------------------------------------------------------------*/ /* @@ -182012,6 +182020,8 @@ void registerClusterThermostat(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(Id), // + make_unique(Id), // }; commands.RegisterCluster(clusterName, clusterCommands);