@@ -319,15 +319,16 @@ void Instance::HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::Po
319
319
}
320
320
321
321
powerAdjustmentCapability = mDelegate .GetPowerAdjustmentCapability ();
322
- if (powerAdjustmentCapability.IsNull ())
322
+ if (( powerAdjustmentCapability.IsNull ()) || (powerAdjustmentCapability. Value (). powerAdjustCapability . IsNull () ))
323
323
{
324
324
ChipLogError (Zcl, " DEM: powerAdjustmentCapability IsNull" );
325
325
ctx.mCommandHandler .AddStatus (ctx.mRequestPath , Status::ConstraintError);
326
326
return ;
327
327
}
328
328
329
- /* PowerAdjustmentCapability is a list - so iterate through checking if the command is within one of the offers */
330
- for (auto pas : powerAdjustmentCapability.Value ())
329
+ /* PowerAdjustmentCapability is a list within a powerAdjustmentCapability structure
330
+ so iterate through checking if the command is within one of the offers */
331
+ for (auto pas : powerAdjustmentCapability.Value ().powerAdjustCapability .Value ())
331
332
{
332
333
if ((power >= pas.minPower ) && (durationSec >= pas.minDuration ) && (power <= pas.maxPower ) &&
333
334
(durationSec <= pas.maxDuration ))
@@ -530,10 +531,10 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq
530
531
return ;
531
532
}
532
533
533
- /* We expect that there should be a slotIsPauseable entry (but it is optional) */
534
- if (!forecast.Value ().slots [activeSlotNumber].slotIsPauseable .HasValue ())
534
+ /* We expect that there should be a slotIsPausable entry (but it is optional) */
535
+ if (!forecast.Value ().slots [activeSlotNumber].slotIsPausable .HasValue ())
535
536
{
536
- ChipLogError (Zcl, " DEM: activeSlotNumber %d does not include slotIsPauseable ." , activeSlotNumber);
537
+ ChipLogError (Zcl, " DEM: activeSlotNumber %d does not include slotIsPausable ." , activeSlotNumber);
537
538
ctx.mCommandHandler .AddStatus (ctx.mRequestPath , Status::Failure);
538
539
return ;
539
540
}
@@ -552,7 +553,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq
552
553
return ;
553
554
}
554
555
555
- if (!forecast.Value ().slots [activeSlotNumber].slotIsPauseable .Value ())
556
+ if (!forecast.Value ().slots [activeSlotNumber].slotIsPausable .Value ())
556
557
{
557
558
ChipLogError (Zcl, " DEM: activeSlotNumber %d is NOT pauseable." , activeSlotNumber);
558
559
ctx.mCommandHandler .AddStatus (ctx.mRequestPath , Status::ConstraintError);
@@ -609,7 +610,7 @@ void Instance::HandleModifyForecastRequest(HandlerContext & ctx, const Commands:
609
610
Status status;
610
611
DataModel::Nullable<Structs::ForecastStruct::Type> forecast;
611
612
612
- uint32_t forecastId = commandData.forecastId ;
613
+ uint32_t forecastID = commandData.forecastID ;
613
614
DataModel::DecodableList<Structs::SlotAdjustmentStruct::Type> slotAdjustments = commandData.slotAdjustments ;
614
615
AdjustmentCauseEnum adjustmentCause = commandData.cause ;
615
616
@@ -629,7 +630,7 @@ void Instance::HandleModifyForecastRequest(HandlerContext & ctx, const Commands:
629
630
return ;
630
631
}
631
632
632
- status = mDelegate .ModifyForecastRequest (forecastId , slotAdjustments, adjustmentCause);
633
+ status = mDelegate .ModifyForecastRequest (forecastID , slotAdjustments, adjustmentCause);
633
634
ctx.mCommandHandler .AddStatus (ctx.mRequestPath , status);
634
635
if (status != Status::Success)
635
636
{
0 commit comments