mirror of
https://github.com/esphome/esphome.git
synced 2026-02-06 09:49:39 -07:00
Compare commits
2 Commits
template_s
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4110bf650 | ||
|
|
ff6f7d3248 |
@@ -2,6 +2,7 @@
|
|||||||
#include "esphome/core/defines.h"
|
#include "esphome/core/defines.h"
|
||||||
#include "esphome/core/controller_registry.h"
|
#include "esphome/core/controller_registry.h"
|
||||||
#include "esphome/core/log.h"
|
#include "esphome/core/log.h"
|
||||||
|
#include "esphome/core/progmem.h"
|
||||||
|
|
||||||
namespace esphome::lock {
|
namespace esphome::lock {
|
||||||
|
|
||||||
@@ -84,21 +85,21 @@ LockCall &LockCall::set_state(optional<LockState> state) {
|
|||||||
this->state_ = state;
|
this->state_ = state;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
LockCall &LockCall::set_state(const std::string &state) {
|
LockCall &LockCall::set_state(const char *state) {
|
||||||
if (str_equals_case_insensitive(state, "LOCKED")) {
|
if (ESPHOME_strcasecmp_P(state, ESPHOME_PSTR("LOCKED")) == 0) {
|
||||||
this->set_state(LOCK_STATE_LOCKED);
|
this->set_state(LOCK_STATE_LOCKED);
|
||||||
} else if (str_equals_case_insensitive(state, "UNLOCKED")) {
|
} else if (ESPHOME_strcasecmp_P(state, ESPHOME_PSTR("UNLOCKED")) == 0) {
|
||||||
this->set_state(LOCK_STATE_UNLOCKED);
|
this->set_state(LOCK_STATE_UNLOCKED);
|
||||||
} else if (str_equals_case_insensitive(state, "JAMMED")) {
|
} else if (ESPHOME_strcasecmp_P(state, ESPHOME_PSTR("JAMMED")) == 0) {
|
||||||
this->set_state(LOCK_STATE_JAMMED);
|
this->set_state(LOCK_STATE_JAMMED);
|
||||||
} else if (str_equals_case_insensitive(state, "LOCKING")) {
|
} else if (ESPHOME_strcasecmp_P(state, ESPHOME_PSTR("LOCKING")) == 0) {
|
||||||
this->set_state(LOCK_STATE_LOCKING);
|
this->set_state(LOCK_STATE_LOCKING);
|
||||||
} else if (str_equals_case_insensitive(state, "UNLOCKING")) {
|
} else if (ESPHOME_strcasecmp_P(state, ESPHOME_PSTR("UNLOCKING")) == 0) {
|
||||||
this->set_state(LOCK_STATE_UNLOCKING);
|
this->set_state(LOCK_STATE_UNLOCKING);
|
||||||
} else if (str_equals_case_insensitive(state, "NONE")) {
|
} else if (ESPHOME_strcasecmp_P(state, ESPHOME_PSTR("NONE")) == 0) {
|
||||||
this->set_state(LOCK_STATE_NONE);
|
this->set_state(LOCK_STATE_NONE);
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGW(TAG, "'%s' - Unrecognized state %s", this->parent_->get_name().c_str(), state.c_str());
|
ESP_LOGW(TAG, "'%s' - Unrecognized state %s", this->parent_->get_name().c_str(), state);
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,8 @@ class LockCall {
|
|||||||
/// Set the state of the lock device.
|
/// Set the state of the lock device.
|
||||||
LockCall &set_state(optional<LockState> state);
|
LockCall &set_state(optional<LockState> state);
|
||||||
/// Set the state of the lock device based on a string.
|
/// Set the state of the lock device based on a string.
|
||||||
LockCall &set_state(const std::string &state);
|
LockCall &set_state(const char *state);
|
||||||
|
LockCall &set_state(const std::string &state) { return this->set_state(state.c_str()); }
|
||||||
|
|
||||||
void perform();
|
void perform();
|
||||||
|
|
||||||
|
|||||||
@@ -94,3 +94,29 @@ DriverChip(
|
|||||||
(0x29, 0x00),
|
(0x29, 0x00),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
DriverChip(
|
||||||
|
"WAVESHARE-ESP32-P4-WIFI6-TOUCH-LCD-7B",
|
||||||
|
height=600,
|
||||||
|
width=1024,
|
||||||
|
hsync_back_porch=160,
|
||||||
|
hsync_pulse_width=10,
|
||||||
|
hsync_front_porch=160,
|
||||||
|
vsync_back_porch=23,
|
||||||
|
vsync_pulse_width=1,
|
||||||
|
vsync_front_porch=12,
|
||||||
|
pclk_frequency="52MHz",
|
||||||
|
lane_bit_rate="900Mbps",
|
||||||
|
no_transform=True,
|
||||||
|
color_order="RGB",
|
||||||
|
initsequence=[
|
||||||
|
(0x80, 0x8B),
|
||||||
|
(0x81, 0x78),
|
||||||
|
(0x82, 0x84),
|
||||||
|
(0x83, 0x88),
|
||||||
|
(0x84, 0xA8),
|
||||||
|
(0x85, 0xE3),
|
||||||
|
(0x86, 0x88),
|
||||||
|
(0xB2, 0x10),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user