HyperionUsbAsp supports both ws2801 and ws2812 led strips (#438)

Re-add this option to the schema
This commit is contained in:
penfold42 2017-05-16 21:45:42 +10:00 committed by brindosch
parent 1bff517adf
commit 93d520706e
5 changed files with 14 additions and 4 deletions

View File

@ -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",

View File

@ -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",

View File

@ -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"
}
}

View File

@ -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;

View File

@ -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
}