mirror of
https://github.com/esphome/esphome.git
synced 2025-04-14 23:00:29 +01:00
Tuya invalid command 0x22 (#6980)
This commit is contained in:
parent
192718fee6
commit
10504c4d68
@ -223,13 +223,19 @@ void Tuya::handle_command_(uint8_t command, uint8_t version, const uint8_t *buff
|
|||||||
break;
|
break;
|
||||||
case TuyaCommandType::DATAPOINT_DELIVER:
|
case TuyaCommandType::DATAPOINT_DELIVER:
|
||||||
break;
|
break;
|
||||||
case TuyaCommandType::DATAPOINT_REPORT:
|
case TuyaCommandType::DATAPOINT_REPORT_ASYNC:
|
||||||
|
case TuyaCommandType::DATAPOINT_REPORT_SYNC:
|
||||||
if (this->init_state_ == TuyaInitState::INIT_DATAPOINT) {
|
if (this->init_state_ == TuyaInitState::INIT_DATAPOINT) {
|
||||||
this->init_state_ = TuyaInitState::INIT_DONE;
|
this->init_state_ = TuyaInitState::INIT_DONE;
|
||||||
this->set_timeout("datapoint_dump", 1000, [this] { this->dump_config(); });
|
this->set_timeout("datapoint_dump", 1000, [this] { this->dump_config(); });
|
||||||
this->initialized_callback_.call();
|
this->initialized_callback_.call();
|
||||||
}
|
}
|
||||||
this->handle_datapoints_(buffer, len);
|
this->handle_datapoints_(buffer, len);
|
||||||
|
|
||||||
|
if (command_type == TuyaCommandType::DATAPOINT_REPORT_SYNC) {
|
||||||
|
this->send_command_(
|
||||||
|
TuyaCommand{.cmd = TuyaCommandType::DATAPOINT_REPORT_ACK, .payload = std::vector<uint8_t>{0x01}});
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case TuyaCommandType::DATAPOINT_QUERY:
|
case TuyaCommandType::DATAPOINT_QUERY:
|
||||||
break;
|
break;
|
||||||
@ -423,7 +429,7 @@ void Tuya::send_raw_command_(TuyaCommand command) {
|
|||||||
break;
|
break;
|
||||||
case TuyaCommandType::DATAPOINT_DELIVER:
|
case TuyaCommandType::DATAPOINT_DELIVER:
|
||||||
case TuyaCommandType::DATAPOINT_QUERY:
|
case TuyaCommandType::DATAPOINT_QUERY:
|
||||||
this->expected_response_ = TuyaCommandType::DATAPOINT_REPORT;
|
this->expected_response_ = TuyaCommandType::DATAPOINT_REPORT_ASYNC;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -53,10 +53,12 @@ enum class TuyaCommandType : uint8_t {
|
|||||||
WIFI_RESET = 0x04,
|
WIFI_RESET = 0x04,
|
||||||
WIFI_SELECT = 0x05,
|
WIFI_SELECT = 0x05,
|
||||||
DATAPOINT_DELIVER = 0x06,
|
DATAPOINT_DELIVER = 0x06,
|
||||||
DATAPOINT_REPORT = 0x07,
|
DATAPOINT_REPORT_ASYNC = 0x07,
|
||||||
DATAPOINT_QUERY = 0x08,
|
DATAPOINT_QUERY = 0x08,
|
||||||
WIFI_TEST = 0x0E,
|
WIFI_TEST = 0x0E,
|
||||||
LOCAL_TIME_QUERY = 0x1C,
|
LOCAL_TIME_QUERY = 0x1C,
|
||||||
|
DATAPOINT_REPORT_SYNC = 0x22,
|
||||||
|
DATAPOINT_REPORT_ACK = 0x23,
|
||||||
WIFI_RSSI = 0x24,
|
WIFI_RSSI = 0x24,
|
||||||
VACUUM_MAP_UPLOAD = 0x28,
|
VACUUM_MAP_UPLOAD = 0x28,
|
||||||
GET_NETWORK_STATUS = 0x2B,
|
GET_NETWORK_STATUS = 0x2B,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user