mirror of
https://github.com/anklimov/lighthub
synced 2025-12-10 21:59:50 +03:00
lighthub/main.cpp:201:77: error: invalid conversion from 'byte* {aka unsigned char*}' to 'const char*' [-fpermissive]
This commit is contained in:
@@ -178,7 +178,8 @@ void mqttCallback(char *topic, byte *payload, unsigned int length) {
|
||||
|
||||
Item item(subtopic);
|
||||
if (item.isValid()) {
|
||||
if (item.itemType==CH_GROUP && retaining) return; //Do not restore group channels - they consist not relevant data
|
||||
if (item.itemType == CH_GROUP && retaining)
|
||||
return; //Do not restore group channels - they consist not relevant data
|
||||
switch (cmd) {
|
||||
case 0: {
|
||||
short i = 0;
|
||||
@@ -197,8 +198,8 @@ void mqttCallback(char *topic, byte *payload, unsigned int length) {
|
||||
case -3: //RGB color in #RRGGBB notation
|
||||
{
|
||||
CRGB rgb;
|
||||
if (sscanf(payload,"#%2X%2X%2X",&rgb.r,&rgb.g,&rgb.b)==3)
|
||||
{ int Par[3];
|
||||
if (sscanf((const char*)payload, "#%2X%2X%2X", &rgb.r, &rgb.g, &rgb.b) == 3) {
|
||||
int Par[3];
|
||||
CHSV hsv = rgb2hsv_approximate(rgb);
|
||||
Par[0] = map(hsv.h, 0, 255, 0, 365);
|
||||
Par[1] = map(hsv.s, 0, 255, 0, 100);
|
||||
@@ -1088,9 +1089,7 @@ void thermoLoop(void) {
|
||||
Serial.print(F(" Curtemp:"));
|
||||
Serial.print(curtemp);
|
||||
Serial.print(F(" cmd:"));
|
||||
Serial.print(itemCommand),
|
||||
|
||||
pinMode(itemPin, OUTPUT);
|
||||
Serial.print(itemCommand), pinMode(itemPin, OUTPUT);
|
||||
if (itemCommand == CMD_OFF || itemCommand == CMD_HALT ||
|
||||
aJson.getArrayItem(itemExtensionArray, IET_ATTEMPTS)->valueint == 0) {
|
||||
digitalWrite(itemPin, LOW);
|
||||
|
||||
Reference in New Issue
Block a user