feat: sACN-Belegung rgb als Vorgabe
Pixelorientierte Werkzeuge wie LedFx schreiben drei Kanaele je Pixel; mit dem Dimmer voran landet deren erstes Pixel auf Dimmer, R, G. rgb ist damit die Belegung, die out of the box das Richtige tut - der Dimmer bleibt fuer DMX-Pulte eine Umschaltung entfernt.
This commit is contained in:
+12
-8
@@ -361,7 +361,8 @@ static void test_settings_exposes_sacn_block(void)
|
||||
TEST_ASSERT_EQUAL_INT(1, (int)cJSON_GetNumberValue(sacn_field("universe")));
|
||||
TEST_ASSERT_EQUAL_INT(1, (int)cJSON_GetNumberValue(sacn_field("start_slot")));
|
||||
TEST_ASSERT_EQUAL_STRING("release", cJSON_GetStringValue(sacn_field("on_timeout")));
|
||||
TEST_ASSERT_EQUAL_INT(6, (int)cJSON_GetNumberValue(sacn_field("slots")));
|
||||
TEST_ASSERT_EQUAL_STRING("rgb", cJSON_GetStringValue(sacn_field("layout")));
|
||||
TEST_ASSERT_EQUAL_INT(3, (int)cJSON_GetNumberValue(sacn_field("slots")));
|
||||
}
|
||||
|
||||
static void test_settings_sacn_block_reflects_stored_values(void)
|
||||
@@ -442,6 +443,7 @@ static void test_put_sacn_rejects_fractional_numbers(void)
|
||||
/* Ein Board mit RGB braucht 6 Slots: ab 508 passt der Satz nicht mehr ins Universe. */
|
||||
static void test_put_sacn_start_slot_must_leave_room_for_all_slots(void)
|
||||
{
|
||||
fake_settings.sacn_layout = 0; /* die Vorgabe ist rgb mit 3 Slots - hier geht es um 6 */
|
||||
call(NL_HTTP_PUT, "/api/v1/system/settings", TOKEN, "{\"type\":\"sacn\",\"start_slot\":507}");
|
||||
TEST_ASSERT_EQUAL_INT(200, resp.status);
|
||||
call(NL_HTTP_PUT, "/api/v1/system/settings", TOKEN, "{\"type\":\"sacn\",\"start_slot\":508}");
|
||||
@@ -451,7 +453,9 @@ static void test_put_sacn_start_slot_must_leave_room_for_all_slots(void)
|
||||
|
||||
static void test_put_sacn_start_slot_limit_follows_the_board(void)
|
||||
{
|
||||
fake_api_reset("g95_cw"); /* drei Slots: 510 passt noch */
|
||||
fake_api_reset("g95_cw");
|
||||
fake_settings.sacn_layout = 0; /* im dimmer-Layout haengt die Slotzahl am Board */
|
||||
/* Ein Board ohne Farbe hat auch mit Dimmer nur drei Slots: 510 passt noch. */
|
||||
call(NL_HTTP_PUT, "/api/v1/system/settings", TOKEN, "{\"type\":\"sacn\",\"start_slot\":510}");
|
||||
TEST_ASSERT_EQUAL_INT(200, resp.status);
|
||||
call(NL_HTTP_PUT, "/api/v1/system/settings", TOKEN, "{\"type\":\"sacn\",\"start_slot\":511}");
|
||||
@@ -512,15 +516,15 @@ static void test_commands(void)
|
||||
|
||||
static void test_settings_reports_the_layout_and_matching_slots(void)
|
||||
{
|
||||
call(NL_HTTP_GET, "/api/v1/system/settings", TOKEN, NULL);
|
||||
/* Vorgabe: rgb - und darin belegt auch ein Board mit Farbe nur drei Slots. */
|
||||
TEST_ASSERT_EQUAL_STRING("rgb", cJSON_GetStringValue(sacn_field("layout")));
|
||||
TEST_ASSERT_EQUAL_INT(3, (int)cJSON_GetNumberValue(sacn_field("slots")));
|
||||
|
||||
fake_settings.sacn_layout = 0;
|
||||
call(NL_HTTP_GET, "/api/v1/system/settings", TOKEN, NULL);
|
||||
TEST_ASSERT_EQUAL_STRING("dimmer", cJSON_GetStringValue(sacn_field("layout")));
|
||||
TEST_ASSERT_EQUAL_INT(6, (int)cJSON_GetNumberValue(sacn_field("slots")));
|
||||
|
||||
fake_settings.sacn_layout = 1;
|
||||
call(NL_HTTP_GET, "/api/v1/system/settings", TOKEN, NULL);
|
||||
TEST_ASSERT_EQUAL_STRING("rgb", cJSON_GetStringValue(sacn_field("layout")));
|
||||
/* Im rgb-Layout belegt auch ein Board mit Farbe nur drei Slots. */
|
||||
TEST_ASSERT_EQUAL_INT(3, (int)cJSON_GetNumberValue(sacn_field("slots")));
|
||||
}
|
||||
|
||||
static void test_put_sacn_layout(void)
|
||||
|
||||
Reference in New Issue
Block a user