mirror of
https://github.com/esphome/esphome.git
synced 2024-11-28 09:44:12 +01:00
fix some CI Lint requests
This commit is contained in:
parent
03d2c8b837
commit
02d9e423c3
2 changed files with 4 additions and 7 deletions
|
@ -31,7 +31,7 @@ NewPeerAction = espnow_ns.class_("NewPeerAction", automation.Action)
|
||||||
DelPeerAction = espnow_ns.class_("DelPeerAction", automation.Action)
|
DelPeerAction = espnow_ns.class_("DelPeerAction", automation.Action)
|
||||||
|
|
||||||
CONF_AUTO_ADD_PEER = "auto_add_peer"
|
CONF_AUTO_ADD_PEER = "auto_add_peer"
|
||||||
CONF_CONVORMATION_TIMEOUT = "conformation_timeout"
|
CONF_CONFORMATION_TIMEOUT = "conformation_timeout"
|
||||||
CONF_ESPNOW = "espnow"
|
CONF_ESPNOW = "espnow"
|
||||||
CONF_RETRIES = "retries"
|
CONF_RETRIES = "retries"
|
||||||
CONF_ON_RECEIVE = "on_receive"
|
CONF_ON_RECEIVE = "on_receive"
|
||||||
|
@ -60,7 +60,7 @@ CONFIG_SCHEMA = cv.Schema(
|
||||||
cv.Optional(CONF_AUTO_ADD_PEER, default=False): cv.boolean,
|
cv.Optional(CONF_AUTO_ADD_PEER, default=False): cv.boolean,
|
||||||
cv.Optional(CONF_USE_SENT_CHECK, default=True): cv.boolean,
|
cv.Optional(CONF_USE_SENT_CHECK, default=True): cv.boolean,
|
||||||
cv.Optional(
|
cv.Optional(
|
||||||
CONF_CONVORMATION_TIMEOUT, default="5000ms"
|
CONF_CONFORMATION_TIMEOUT, default="5000ms"
|
||||||
): cv.positive_time_period_milliseconds,
|
): cv.positive_time_period_milliseconds,
|
||||||
cv.Optional(CONF_RETRIES, default=5): cv.int_range(min=1, max=10),
|
cv.Optional(CONF_RETRIES, default=5): cv.int_range(min=1, max=10),
|
||||||
cv.Optional(CONF_ON_RECEIVE): automation.validate_automation(
|
cv.Optional(CONF_ON_RECEIVE): automation.validate_automation(
|
||||||
|
@ -99,7 +99,7 @@ async def to_code(config):
|
||||||
cg.add(var.set_wifi_channel(config[CONF_WIFI_CHANNEL]))
|
cg.add(var.set_wifi_channel(config[CONF_WIFI_CHANNEL]))
|
||||||
cg.add(var.set_auto_add_peer(config[CONF_AUTO_ADD_PEER]))
|
cg.add(var.set_auto_add_peer(config[CONF_AUTO_ADD_PEER]))
|
||||||
cg.add(var.set_use_sent_check(config[CONF_USE_SENT_CHECK]))
|
cg.add(var.set_use_sent_check(config[CONF_USE_SENT_CHECK]))
|
||||||
cg.add(var.set_convermation_timeout(config[CONF_CONVORMATION_TIMEOUT]))
|
cg.add(var.set_convermation_timeout(config[CONF_CONFORMATION_TIMEOUT]))
|
||||||
cg.add(var.set_retries(config[CONF_RETRIES]))
|
cg.add(var.set_retries(config[CONF_RETRIES]))
|
||||||
|
|
||||||
for conf in config.get(CONF_ON_SENT, []):
|
for conf in config.get(CONF_ON_SENT, []):
|
||||||
|
|
|
@ -195,10 +195,7 @@ class ESPNowComponent : public Component {
|
||||||
void set_wifi_channel(uint8_t channel) { this->wifi_channel_ = channel; }
|
void set_wifi_channel(uint8_t channel) { this->wifi_channel_ = channel; }
|
||||||
void set_auto_add_peer(bool value) { this->auto_add_peer_ = value; }
|
void set_auto_add_peer(bool value) { this->auto_add_peer_ = value; }
|
||||||
void set_use_sent_check(bool value) { this->use_sent_check_ = value; }
|
void set_use_sent_check(bool value) { this->use_sent_check_ = value; }
|
||||||
void set_convermation_timeout(uint32_t timeout) {
|
void set_convermation_timeout(uint32_t timeout) { this->conformation_timeout_ = timeout; }
|
||||||
this->conformation_timeout_ = timeout;
|
|
||||||
ESP_LOGD("ESPNOW", "%d", timeout);
|
|
||||||
}
|
|
||||||
void set_retries(uint8_t value) { this->retries_ = value; }
|
void set_retries(uint8_t value) { this->retries_ = value; }
|
||||||
|
|
||||||
void setup() override;
|
void setup() override;
|
||||||
|
|
Loading…
Reference in a new issue