mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-13 11:02:12 +01:00
Somfy: add initial sun awnings support
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
parent
847a808351
commit
f632dc9c54
3 changed files with 17 additions and 1 deletions
14
Somfy.cpp
14
Somfy.cpp
|
|
@ -147,6 +147,12 @@ void somfy_frame_t::decodeFrame(byte* frame) {
|
|||
case 140:
|
||||
this->cmd = somfy_commands::Prog;
|
||||
break;
|
||||
case 141:
|
||||
this->cmd = somfy_commands::SunFlag;
|
||||
break;
|
||||
case 142:
|
||||
this->cmd = somfy_commands::Flag;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this->rollingCode = decoded[3] + (decoded[2] << 8);
|
||||
|
|
@ -280,6 +286,12 @@ void somfy_frame_t::encodeFrame(byte *frame) {
|
|||
case somfy_commands::Prog:
|
||||
frame[0] = 140;
|
||||
break;
|
||||
case somfy_commands::SunFlag:
|
||||
frame[0] = 141;
|
||||
break;
|
||||
case somfy_commands::Flag:
|
||||
frame[0] = 142;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -1420,6 +1432,8 @@ bool SomfyShade::fromJSON(JsonObject &obj) {
|
|||
this->shadeType = shade_types::drapery;
|
||||
else if(strncmp(obj["shadeType"].as<const char *>(), "blind", 5) == 0)
|
||||
this->shadeType = shade_types::blind;
|
||||
else if(strncmp(obj["shadeType"].as<const char *>(), "awning", 7) == 0)
|
||||
this->shadeType = shade_types::awning;
|
||||
}
|
||||
else {
|
||||
this->shadeType = static_cast<shade_types>(obj["shadeType"].as<uint8_t>());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue