Skip to content

Commit 5cf4508

Browse files
committed
Merge branch 'fix/thermostat_bounds' into 'main'
components/esp_matter: Fixed the data type and attribute bounds for thermostat attributes See merge request app-frameworks/esp-matter!1093
2 parents 210311d + f4f4e6f commit 5cf4508

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

components/esp_matter/esp_matter_attribute_bounds.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -570,79 +570,79 @@ void add_bounds_cb(cluster_t *cluster)
570570
case Thermostat::Attributes::OccupiedSetback::Id: {
571571
esp_matter_attr_val_t min_val = esp_matter_invalid(NULL);
572572
esp_matter_attr_val_t max_val = esp_matter_invalid(NULL);
573-
nullable<uint16_t> min = 0, max = UINT16_MAX;
573+
nullable<uint8_t> min = 0, max = 254;
574574
if(cluster::get_attribute_value(cluster, Thermostat::Attributes::OccupiedSetbackMin::Id,
575575
&min_val) == ESP_OK)
576576
{
577-
min = min_val.val.u16;
577+
min = min_val.val.u8;
578578
}
579579
if(cluster::get_attribute_value(cluster, Thermostat::Attributes::OccupiedSetbackMax::Id,
580580
&max_val) == ESP_OK)
581581
{
582-
max = max_val.val.u16;
582+
max = max_val.val.u8;
583583
}
584-
esp_matter::attribute::add_bounds(current_attribute, esp_matter_nullable_uint16(min), esp_matter_nullable_uint16(max));
584+
esp_matter::attribute::add_bounds(current_attribute, esp_matter_nullable_uint8(min), esp_matter_nullable_uint8(max));
585585
break;
586586
}
587587
case Thermostat::Attributes::OccupiedSetbackMin::Id: {
588588
esp_matter_attr_val_t max_val = esp_matter_invalid(NULL);
589-
nullable<uint16_t> min = 0, max = UINT16_MAX;
589+
nullable<uint8_t> min = 0, max = 254;
590590
if(cluster::get_attribute_value(cluster, Thermostat::Attributes::OccupiedSetbackMax::Id,
591591
&max_val) == ESP_OK)
592592
{
593-
max = max_val.val.u16;
593+
max = max_val.val.u8;
594594
}
595-
esp_matter::attribute::add_bounds(current_attribute, esp_matter_nullable_uint16(min), esp_matter_nullable_uint16(max));
595+
esp_matter::attribute::add_bounds(current_attribute, esp_matter_nullable_uint8(min), esp_matter_nullable_uint8(max));
596596
break;
597597
}
598598
case Thermostat::Attributes::OccupiedSetbackMax::Id: {
599599
esp_matter_attr_val_t min_val = esp_matter_invalid(NULL);
600-
nullable<uint16_t> min = 0, max = 2540;
600+
nullable<uint8_t> min = 0, max = 254;
601601
if(cluster::get_attribute_value(cluster, Thermostat::Attributes::OccupiedSetbackMin::Id,
602602
&min_val) == ESP_OK)
603603
{
604-
min = min_val.val.u16;
604+
min = min_val.val.u8;
605605
}
606-
esp_matter::attribute::add_bounds(current_attribute, esp_matter_nullable_uint16(min), esp_matter_nullable_uint16(max));
606+
esp_matter::attribute::add_bounds(current_attribute, esp_matter_nullable_uint8(min), esp_matter_nullable_uint8(max));
607607
break;
608608
}
609609
case Thermostat::Attributes::UnoccupiedSetback::Id: {
610610
esp_matter_attr_val_t min_val = esp_matter_invalid(NULL);
611611
esp_matter_attr_val_t max_val = esp_matter_invalid(NULL);
612-
nullable<uint16_t> min = 0, max = UINT16_MAX;
612+
nullable<uint8_t> min = 0, max = 254;
613613
if(cluster::get_attribute_value(cluster, Thermostat::Attributes::UnoccupiedSetbackMin::Id,
614614
&min_val) == ESP_OK)
615615
{
616-
min = min_val.val.u16;
616+
min = min_val.val.u8;
617617
}
618618
if(cluster::get_attribute_value(cluster, Thermostat::Attributes::UnoccupiedSetbackMax::Id,
619619
&max_val) == ESP_OK)
620620
{
621-
max = max_val.val.u16;
621+
max = max_val.val.u8;
622622
}
623-
esp_matter::attribute::add_bounds(current_attribute, esp_matter_nullable_uint16(min), esp_matter_nullable_uint16(max));
623+
esp_matter::attribute::add_bounds(current_attribute, esp_matter_nullable_uint8(min), esp_matter_nullable_uint8(max));
624624
break;
625625
}
626626
case Thermostat::Attributes::UnoccupiedSetbackMin::Id: {
627627
esp_matter_attr_val_t max_val = esp_matter_invalid(NULL);
628-
nullable<uint16_t> min = 0, max = UINT16_MAX;
628+
nullable<uint8_t> min = 0, max = 254;
629629
if(cluster::get_attribute_value(cluster, Thermostat::Attributes::UnoccupiedSetbackMax::Id,
630630
&max_val) == ESP_OK)
631631
{
632-
max = max_val.val.u16;
632+
max = max_val.val.u8;
633633
}
634-
esp_matter::attribute::add_bounds(current_attribute, esp_matter_nullable_uint16(min), esp_matter_nullable_uint16(max));
634+
esp_matter::attribute::add_bounds(current_attribute, esp_matter_nullable_uint8(min), esp_matter_nullable_uint8(max));
635635
break;
636636
}
637637
case Thermostat::Attributes::UnoccupiedSetbackMax::Id: {
638638
esp_matter_attr_val_t min_val = esp_matter_invalid(NULL);
639-
nullable<uint16_t> min = 0, max = 2540;
639+
nullable<uint8_t> min = 0, max = 254;
640640
if(cluster::get_attribute_value(cluster, Thermostat::Attributes::UnoccupiedSetbackMin::Id,
641641
&min_val) == ESP_OK)
642642
{
643-
min = min_val.val.u16;
643+
min = min_val.val.u8;
644644
}
645-
esp_matter::attribute::add_bounds(current_attribute, esp_matter_nullable_uint16(min), esp_matter_nullable_uint16(max));
645+
esp_matter::attribute::add_bounds(current_attribute, esp_matter_nullable_uint8(min), esp_matter_nullable_uint8(max));
646646
break;
647647
}
648648
case Thermostat::Attributes::ACRefrigerantType::Id:

0 commit comments

Comments
 (0)