mirror of
https://github.com/esphome/esphome.git
synced 2024-11-30 10:44:13 +01:00
chore(mr60fda2): edit value
This commit is contained in:
parent
02b1eb6382
commit
e0ee4a5bdd
4 changed files with 6 additions and 6 deletions
|
@ -16,7 +16,7 @@ GetRadarParametersButton = mr60fda2_ns.class_("GetRadarParametersButton", button
|
|||
ResetRadarButton = mr60fda2_ns.class_("ResetRadarButton", button.Button)
|
||||
|
||||
CONF_GET_RADAR_PARAMETERS = "get_radar_parameters"
|
||||
CONF_FACTORY_RESET = "reset_radar"
|
||||
CONF_FACTORY_RESET = "factory_reset"
|
||||
|
||||
CONFIG_SCHEMA = {
|
||||
cv.GenerateID(CONF_MR60FDA2_ID): cv.use_id(MR60FDA2Component),
|
||||
|
@ -39,7 +39,7 @@ async def to_code(config):
|
|||
b = await button.new_button(get_radar_parameters_config)
|
||||
await cg.register_parented(b, config[CONF_MR60FDA2_ID])
|
||||
cg.add(mr60fda2_component.set_get_radar_parameters_button(b))
|
||||
if reset_radar_config := config.get(CONF_FACTORY_RESET):
|
||||
b = await button.new_button(reset_radar_config)
|
||||
if factory_reset_config := config.get(CONF_FACTORY_RESET):
|
||||
b = await button.new_button(factory_reset_config)
|
||||
await cg.register_parented(b, config[CONF_MR60FDA2_ID])
|
||||
cg.add(mr60fda2_component.set_factory_reset_button(b))
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace esphome {
|
||||
namespace seeed_mr60fda2 {
|
||||
|
||||
void ResetRadarButton::press_action() { this->parent_->reset_radar(); }
|
||||
void ResetRadarButton::press_action() { this->parent_->factory_reset(); }
|
||||
|
||||
} // namespace seeed_mr60fda2
|
||||
} // namespace esphome
|
||||
|
|
|
@ -377,7 +377,7 @@ void MR60FDA2Component::get_radar_parameters() {
|
|||
ESP_LOGV(TAG, "SEND GET PARAMETERS: %s", format_hex_pretty(send_data, 8).c_str());
|
||||
}
|
||||
|
||||
void MR60FDA2Component::reset_radar() {
|
||||
void MR60FDA2Component::factory_reset() {
|
||||
uint8_t send_data[8] = {0x01, 0x00, 0x00, 0x00, 0x00, 0x21, 0x10, 0xCF};
|
||||
this->send_query_(send_data, 8);
|
||||
ESP_LOGV(TAG, "SEND RESET: %s", format_hex_pretty(send_data, 8).c_str());
|
||||
|
|
|
@ -101,7 +101,7 @@ class MR60FDA2Component : public Component,
|
|||
void set_height_threshold(uint8_t index);
|
||||
void set_sensitivity(uint8_t index);
|
||||
void get_radar_parameters();
|
||||
void reset_radar();
|
||||
void factory_reset();
|
||||
};
|
||||
|
||||
} // namespace seeed_mr60fda2
|
||||
|
|
Loading…
Reference in a new issue