This commit is contained in:
Edward Firmo
2025-08-06 16:34:52 +02:00
parent 0fb4b5fe09
commit 3c53b21fbe

View File

@@ -570,7 +570,7 @@ script:
- lambda: |- - lambda: |-
auto attrs_pair = tx_ultimate_easy::unpack_dual_light_attributes(*attr_global_ptr); auto attrs_pair = tx_ultimate_easy::unpack_dual_light_attributes(*attr_global_ptr);
tx_ultimate_easy::LightAttributes attrs = (group_index == 1) ? attrs_pair.first : attrs_pair.second; tx_ultimate_easy::LightAttributes attrs = (group_index == 1) ? attrs_pair.first : attrs_pair.second;
auto call = light_ptr->make_call(); auto call = light_ptr->make_call();
call.set_brightness(attrs.brightness / 100.0f); call.set_brightness(attrs.brightness / 100.0f);
call.set_rgb(attrs.red / 255.0f, attrs.green / 255.0f, attrs.blue / 255.0f); call.set_rgb(attrs.red / 255.0f, attrs.green / 255.0f, attrs.blue / 255.0f);
@@ -610,10 +610,10 @@ script:
.green = uint8_t(current.get_green() * 255.0f), .green = uint8_t(current.get_green() * 255.0f),
.blue = uint8_t(current.get_blue() * 255.0f) .blue = uint8_t(current.get_blue() * 255.0f)
}; };
// Unpack existing dual attributes // Unpack existing dual attributes
auto existing = tx_ultimate_easy::unpack_dual_light_attributes(*attr_global_ptr); auto existing = tx_ultimate_easy::unpack_dual_light_attributes(*attr_global_ptr);
// Update the appropriate group // Update the appropriate group
if (group_index == 1) { if (group_index == 1) {
*attr_global_ptr = tx_ultimate_easy::pack_dual_light_attributes(new_attrs, existing.second); *attr_global_ptr = tx_ultimate_easy::pack_dual_light_attributes(new_attrs, existing.second);