mirror of
https://github.com/esphome/esphome.git
synced 2024-12-02 19:54:14 +01:00
Merge branch 'dev' into dev
This commit is contained in:
commit
a84c5abcf4
5 changed files with 45 additions and 7 deletions
|
@ -25,6 +25,9 @@ void QspiAmoLed::setup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void QspiAmoLed::update() {
|
void QspiAmoLed::update() {
|
||||||
|
if (!this->setup_complete_) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this->do_update_();
|
this->do_update_();
|
||||||
// Start addresses and widths/heights must be divisible by 2 (CASET/RASET restriction in datasheet)
|
// Start addresses and widths/heights must be divisible by 2 (CASET/RASET restriction in datasheet)
|
||||||
if (this->x_low_ % 2 == 1) {
|
if (this->x_low_ % 2 == 1) {
|
||||||
|
|
|
@ -8,10 +8,10 @@ static const char *const TAG = "remote.dooya";
|
||||||
|
|
||||||
static const uint32_t HEADER_HIGH_US = 5000;
|
static const uint32_t HEADER_HIGH_US = 5000;
|
||||||
static const uint32_t HEADER_LOW_US = 1500;
|
static const uint32_t HEADER_LOW_US = 1500;
|
||||||
static const uint32_t BIT_ZERO_HIGH_US = 750;
|
static const uint32_t BIT_ZERO_HIGH_US = 350;
|
||||||
static const uint32_t BIT_ZERO_LOW_US = 350;
|
static const uint32_t BIT_ZERO_LOW_US = 750;
|
||||||
static const uint32_t BIT_ONE_HIGH_US = 350;
|
static const uint32_t BIT_ONE_HIGH_US = 750;
|
||||||
static const uint32_t BIT_ONE_LOW_US = 750;
|
static const uint32_t BIT_ONE_LOW_US = 350;
|
||||||
|
|
||||||
void DooyaProtocol::encode(RemoteTransmitData *dst, const DooyaData &data) {
|
void DooyaProtocol::encode(RemoteTransmitData *dst, const DooyaData &data) {
|
||||||
dst->set_carrier_frequency(0);
|
dst->set_carrier_frequency(0);
|
||||||
|
|
|
@ -4,11 +4,13 @@ import esphome.config_validation as cv
|
||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_DEVICE_CLASS,
|
CONF_DEVICE_CLASS,
|
||||||
|
CONF_ENTITY_CATEGORY,
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
CONF_MQTT_ID,
|
CONF_MQTT_ID,
|
||||||
CONF_WEB_SERVER_ID,
|
CONF_WEB_SERVER_ID,
|
||||||
DEVICE_CLASS_EMPTY,
|
DEVICE_CLASS_EMPTY,
|
||||||
DEVICE_CLASS_FIRMWARE,
|
DEVICE_CLASS_FIRMWARE,
|
||||||
|
ENTITY_CATEGORY_CONFIG,
|
||||||
)
|
)
|
||||||
from esphome.core import CORE, coroutine_with_priority
|
from esphome.core import CORE, coroutine_with_priority
|
||||||
from esphome.cpp_helpers import setup_entity
|
from esphome.cpp_helpers import setup_entity
|
||||||
|
@ -41,6 +43,9 @@ UPDATE_SCHEMA = (
|
||||||
cv.Optional(CONF_ON_UPDATE_AVAILABLE): automation.validate_automation(
|
cv.Optional(CONF_ON_UPDATE_AVAILABLE): automation.validate_automation(
|
||||||
single=True
|
single=True
|
||||||
),
|
),
|
||||||
|
cv.Optional(
|
||||||
|
CONF_ENTITY_CATEGORY, default=ENTITY_CATEGORY_CONFIG
|
||||||
|
): cv.entity_category,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,9 +1,35 @@
|
||||||
#include "update_entity.h"
|
#include "update_entity.h"
|
||||||
|
|
||||||
|
#include "esphome/core/log.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace update {
|
namespace update {
|
||||||
|
|
||||||
|
static const char *const TAG = "update";
|
||||||
|
|
||||||
void UpdateEntity::publish_state() {
|
void UpdateEntity::publish_state() {
|
||||||
|
ESP_LOGD(TAG, "'%s' - Publishing:", this->name_.c_str());
|
||||||
|
ESP_LOGD(TAG, " Current Version: %s", this->update_info_.current_version.c_str());
|
||||||
|
|
||||||
|
if (!this->update_info_.md5.empty()) {
|
||||||
|
ESP_LOGD(TAG, " Latest Version: %s", this->update_info_.latest_version.c_str());
|
||||||
|
}
|
||||||
|
if (!this->update_info_.firmware_url.empty()) {
|
||||||
|
ESP_LOGD(TAG, " Firmware URL: %s", this->update_info_.firmware_url.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
ESP_LOGD(TAG, " Title: %s", this->update_info_.title.c_str());
|
||||||
|
if (!this->update_info_.summary.empty()) {
|
||||||
|
ESP_LOGD(TAG, " Summary: %s", this->update_info_.summary.c_str());
|
||||||
|
}
|
||||||
|
if (!this->update_info_.release_url.empty()) {
|
||||||
|
ESP_LOGD(TAG, " Release URL: %s", this->update_info_.release_url.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->update_info_.has_progress) {
|
||||||
|
ESP_LOGD(TAG, " Progress: %.0f%%", this->update_info_.progress);
|
||||||
|
}
|
||||||
|
|
||||||
this->has_state_ = true;
|
this->has_state_ = true;
|
||||||
this->state_callback_.call();
|
this->state_callback_.call();
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,17 +58,21 @@ def merge_config(full_old, full_new):
|
||||||
ids = {
|
ids = {
|
||||||
v_id: i
|
v_id: i
|
||||||
for i, v in enumerate(res)
|
for i, v in enumerate(res)
|
||||||
if (v_id := v.get(CONF_ID)) and isinstance(v_id, str)
|
if isinstance(v, dict)
|
||||||
|
and (v_id := v.get(CONF_ID))
|
||||||
|
and isinstance(v_id, str)
|
||||||
}
|
}
|
||||||
extend_ids = {
|
extend_ids = {
|
||||||
v_id.value: i
|
v_id.value: i
|
||||||
for i, v in enumerate(res)
|
for i, v in enumerate(res)
|
||||||
if (v_id := v.get(CONF_ID)) and isinstance(v_id, Extend)
|
if isinstance(v, dict)
|
||||||
|
and (v_id := v.get(CONF_ID))
|
||||||
|
and isinstance(v_id, Extend)
|
||||||
}
|
}
|
||||||
|
|
||||||
ids_to_delete = []
|
ids_to_delete = []
|
||||||
for v in new:
|
for v in new:
|
||||||
if new_id := v.get(CONF_ID):
|
if isinstance(v, dict) and (new_id := v.get(CONF_ID)):
|
||||||
if isinstance(new_id, Extend):
|
if isinstance(new_id, Extend):
|
||||||
new_id = new_id.value
|
new_id = new_id.value
|
||||||
if new_id in ids:
|
if new_id in ids:
|
||||||
|
|
Loading…
Reference in a new issue