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

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