mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 05:24:53 +01:00
[tuya] add support for extended services (#6808)
This commit is contained in:
parent
4125b48b86
commit
17c6bf57cd
2 changed files with 31 additions and 0 deletions
|
@ -269,6 +269,30 @@ void Tuya::handle_command_(uint8_t command, uint8_t version, const uint8_t *buff
|
|||
ESP_LOGV(TAG, "Network status requested, reported as %i", wifi_status);
|
||||
break;
|
||||
}
|
||||
case TuyaCommandType::EXTENDED_SERVICES: {
|
||||
uint8_t subcommand = buffer[0];
|
||||
switch ((TuyaExtendedServicesCommandType) subcommand) {
|
||||
case TuyaExtendedServicesCommandType::RESET_NOTIFICATION: {
|
||||
this->send_command_(
|
||||
TuyaCommand{.cmd = TuyaCommandType::EXTENDED_SERVICES,
|
||||
.payload = std::vector<uint8_t>{
|
||||
static_cast<uint8_t>(TuyaExtendedServicesCommandType::RESET_NOTIFICATION), 0x00}});
|
||||
ESP_LOGV(TAG, "Reset status notification enabled");
|
||||
break;
|
||||
}
|
||||
case TuyaExtendedServicesCommandType::MODULE_RESET: {
|
||||
ESP_LOGE(TAG, "EXTENDED_SERVICES::MODULE_RESET is not handled");
|
||||
break;
|
||||
}
|
||||
case TuyaExtendedServicesCommandType::UPDATE_IN_PROGRESS: {
|
||||
ESP_LOGE(TAG, "EXTENDED_SERVICES::UPDATE_IN_PROGRESS is not handled");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ESP_LOGE(TAG, "Invalid extended services subcommand (0x%02X) received", subcommand);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ESP_LOGE(TAG, "Invalid command (0x%02X) received", command);
|
||||
}
|
||||
|
|
|
@ -60,6 +60,13 @@ enum class TuyaCommandType : uint8_t {
|
|||
WIFI_RSSI = 0x24,
|
||||
VACUUM_MAP_UPLOAD = 0x28,
|
||||
GET_NETWORK_STATUS = 0x2B,
|
||||
EXTENDED_SERVICES = 0x34,
|
||||
};
|
||||
|
||||
enum class TuyaExtendedServicesCommandType : uint8_t {
|
||||
RESET_NOTIFICATION = 0x04,
|
||||
MODULE_RESET = 0x05,
|
||||
UPDATE_IN_PROGRESS = 0x0A,
|
||||
};
|
||||
|
||||
enum class TuyaInitState : uint8_t {
|
||||
|
|
Loading…
Reference in a new issue