mirror of
https://github.com/esphome/esphome.git
synced 2026-02-05 04:19:40 -07:00
Compare commits
3 Commits
template_s
...
cse7766_st
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf691a43b2 | ||
|
|
d4110bf650 | ||
|
|
ff6f7d3248 |
@@ -152,6 +152,10 @@ void CSE7766Component::parse_data_() {
|
||||
if (this->power_sensor_ != nullptr) {
|
||||
this->power_sensor_->publish_state(power);
|
||||
}
|
||||
} else if (this->power_sensor_ != nullptr) {
|
||||
// No valid power measurement from chip - publish 0W to avoid stale readings
|
||||
// This typically happens when current is below the measurable threshold (~50mA)
|
||||
this->power_sensor_->publish_state(0.0f);
|
||||
}
|
||||
|
||||
float current = 0.0f;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "esphome/core/defines.h"
|
||||
#include "esphome/core/controller_registry.h"
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/core/progmem.h"
|
||||
|
||||
namespace esphome::lock {
|
||||
|
||||
@@ -84,21 +85,21 @@ LockCall &LockCall::set_state(optional<LockState> state) {
|
||||
this->state_ = state;
|
||||
return *this;
|
||||
}
|
||||
LockCall &LockCall::set_state(const std::string &state) {
|
||||
if (str_equals_case_insensitive(state, "LOCKED")) {
|
||||
LockCall &LockCall::set_state(const char *state) {
|
||||
if (ESPHOME_strcasecmp_P(state, ESPHOME_PSTR("LOCKED")) == 0) {
|
||||
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);
|
||||
} else if (str_equals_case_insensitive(state, "JAMMED")) {
|
||||
} else if (ESPHOME_strcasecmp_P(state, ESPHOME_PSTR("JAMMED")) == 0) {
|
||||
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);
|
||||
} else if (str_equals_case_insensitive(state, "UNLOCKING")) {
|
||||
} else if (ESPHOME_strcasecmp_P(state, ESPHOME_PSTR("UNLOCKING")) == 0) {
|
||||
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);
|
||||
} 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;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,8 @@ class LockCall {
|
||||
/// Set the state of the lock device.
|
||||
LockCall &set_state(optional<LockState> state);
|
||||
/// 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();
|
||||
|
||||
|
||||
@@ -94,3 +94,29 @@ DriverChip(
|
||||
(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