diff --git a/assets/webconfig/i18n/de.json b/assets/webconfig/i18n/de.json index f298fefa..70d40c46 100644 --- a/assets/webconfig/i18n/de.json +++ b/assets/webconfig/i18n/de.json @@ -390,6 +390,7 @@ "edt_dev_spec_gpioBcm_title" : "GPIO Pin", "edt_dev_spec_ledIndex_title" : "LED index", "edt_dev_spec_colorComponent_title" : "Farbkomponente", + "edt_dev_spec_ledType_title" : "LED typ", "edt_conf_general_enable_title" : "Aktiviert", "edt_conf_general_enable_expl" : "Wenn aktiviert, ist die Komponente aktiv.", "edt_conf_general_priority_title" : "Priorität", diff --git a/assets/webconfig/i18n/en.json b/assets/webconfig/i18n/en.json index 38670358..4f8eb2be 100644 --- a/assets/webconfig/i18n/en.json +++ b/assets/webconfig/i18n/en.json @@ -372,6 +372,7 @@ "edt_dev_spec_transistionTime_title" : "Transistion time", "edt_dev_spec_switchOffOnBlack_title" : "Switch off on black", "edt_dev_spec_brightnessFactor_title" : "Brightness factor", + "edt_dev_spec_ledType_title" : "LED Type", "edt_dev_spec_uid_title" : "UID", "edt_dev_spec_intervall_title" : "Intervall", "edt_dev_spec_latchtime_title" : "Latch time", diff --git a/assets/webconfig/i18n/es.json b/assets/webconfig/i18n/es.json index 6765e4b2..65042ba8 100644 --- a/assets/webconfig/i18n/es.json +++ b/assets/webconfig/i18n/es.json @@ -347,6 +347,7 @@ "edt_dev_spec_gpioBcm_title": "Pin GPIO", "edt_dev_spec_ledIndex_title": "Índice LED", "edt_dev_spec_colorComponent_title": "Componente de color", + "edt_dev_spec_ledType_title": "Tipo de LED", "edt_conf_general_enable_title": "Activar", "edt_conf_general_enable_expl": "Si está marcada, el componente está habilitado", "edt_conf_general_priority_title": "Canal prioritario", @@ -714,4 +715,4 @@ "wiz_hue_ident": "Identificar", "edt_eff_repeatcount_title": "Repetir cuenta", "edt_eff_maintain_end_color_title": "Mantener color de fin" -} \ No newline at end of file +} diff --git a/libsrc/leddevice/LedDeviceHyperionUsbasp.cpp b/libsrc/leddevice/LedDeviceHyperionUsbasp.cpp index b1f02f38..85553c19 100644 --- a/libsrc/leddevice/LedDeviceHyperionUsbasp.cpp +++ b/libsrc/leddevice/LedDeviceHyperionUsbasp.cpp @@ -41,10 +41,10 @@ bool LedDeviceHyperionUsbasp::init(const QJsonObject &deviceConfig) { LedDevice::init(deviceConfig); - QString ledType = deviceConfig["output"].toString("ws2801"); + QString ledType = deviceConfig["ledType"].toString("ws2801"); if (ledType != "ws2801" && ledType != "ws2812") { - throw std::runtime_error("HyperionUsbasp: invalid output; must be 'ws2801' or 'ws2812'."); + throw std::runtime_error("HyperionUsbasp: invalid ledType; must be 'ws2801' or 'ws2812'."); } _writeLedsCommand = (ledType == "ws2801") ? CMD_WRITE_WS2801 : CMD_WRITE_WS2812; diff --git a/libsrc/leddevice/schemas/schema-hyperionusbasp.json b/libsrc/leddevice/schemas/schema-hyperionusbasp.json index 8f157221..531764ba 100644 --- a/libsrc/leddevice/schemas/schema-hyperionusbasp.json +++ b/libsrc/leddevice/schemas/schema-hyperionusbasp.json @@ -11,7 +11,14 @@ "maximum": 1000, "access" : "expert", "propertyOrder" : 1 - } + }, + "ledType": { + "type": "string", + "title":"edt_dev_spec_ledType_title", + "enum" : ["ws2801","ws2812"], + "default": "ws2801", + "propertyOrder" : 2 + } }, "additionalProperties": true }