mirror of
https://github.com/esphome/esphome.git
synced 2025-11-09 10:58:46 +00:00
Merge branch 'dev' into select_options
This commit is contained in:
@@ -8,8 +8,7 @@
|
|||||||
|
|
||||||
#define BOOTLOADER_VERSION_REGISTER NRF_TIMER2->CC[0]
|
#define BOOTLOADER_VERSION_REGISTER NRF_TIMER2->CC[0]
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome::debug {
|
||||||
namespace debug {
|
|
||||||
|
|
||||||
static const char *const TAG = "debug";
|
static const char *const TAG = "debug";
|
||||||
constexpr std::uintptr_t MBR_PARAM_PAGE_ADDR = 0xFFC;
|
constexpr std::uintptr_t MBR_PARAM_PAGE_ADDR = 0xFFC;
|
||||||
@@ -281,14 +280,18 @@ void DebugComponent::get_device_info_(std::string &device_info) {
|
|||||||
NRF_FICR->INFO.VARIANT & 0xFF, package(NRF_FICR->INFO.PACKAGE));
|
NRF_FICR->INFO.VARIANT & 0xFF, package(NRF_FICR->INFO.PACKAGE));
|
||||||
ESP_LOGD(TAG, "RAM: %ukB, Flash: %ukB, production test: %sdone", NRF_FICR->INFO.RAM, NRF_FICR->INFO.FLASH,
|
ESP_LOGD(TAG, "RAM: %ukB, Flash: %ukB, production test: %sdone", NRF_FICR->INFO.RAM, NRF_FICR->INFO.FLASH,
|
||||||
(NRF_FICR->PRODTEST[0] == 0xBB42319F ? "" : "not "));
|
(NRF_FICR->PRODTEST[0] == 0xBB42319F ? "" : "not "));
|
||||||
|
bool n_reset_enabled = NRF_UICR->PSELRESET[0] == NRF_UICR->PSELRESET[1] &&
|
||||||
|
(NRF_UICR->PSELRESET[0] & UICR_PSELRESET_CONNECT_Msk) == UICR_PSELRESET_CONNECT_Connected
|
||||||
|
<< UICR_PSELRESET_CONNECT_Pos;
|
||||||
ESP_LOGD(
|
ESP_LOGD(
|
||||||
TAG, "GPIO as NFC pins: %s, GPIO as nRESET pin: %s",
|
TAG, "GPIO as NFC pins: %s, GPIO as nRESET pin: %s",
|
||||||
YESNO((NRF_UICR->NFCPINS & UICR_NFCPINS_PROTECT_Msk) == (UICR_NFCPINS_PROTECT_NFC << UICR_NFCPINS_PROTECT_Pos)),
|
YESNO((NRF_UICR->NFCPINS & UICR_NFCPINS_PROTECT_Msk) == (UICR_NFCPINS_PROTECT_NFC << UICR_NFCPINS_PROTECT_Pos)),
|
||||||
YESNO(((NRF_UICR->PSELRESET[0] & UICR_PSELRESET_CONNECT_Msk) !=
|
YESNO(n_reset_enabled));
|
||||||
(UICR_PSELRESET_CONNECT_Connected << UICR_PSELRESET_CONNECT_Pos)) ||
|
if (n_reset_enabled) {
|
||||||
((NRF_UICR->PSELRESET[1] & UICR_PSELRESET_CONNECT_Msk) !=
|
uint8_t port = (NRF_UICR->PSELRESET[0] & UICR_PSELRESET_PORT_Msk) >> UICR_PSELRESET_PORT_Pos;
|
||||||
(UICR_PSELRESET_CONNECT_Connected << UICR_PSELRESET_CONNECT_Pos))));
|
uint8_t pin = (NRF_UICR->PSELRESET[0] & UICR_PSELRESET_PIN_Msk) >> UICR_PSELRESET_PIN_Pos;
|
||||||
|
ESP_LOGD(TAG, "nRESET port P%u.%02u", port, pin);
|
||||||
|
}
|
||||||
#ifdef USE_BOOTLOADER_MCUBOOT
|
#ifdef USE_BOOTLOADER_MCUBOOT
|
||||||
ESP_LOGD(TAG, "bootloader: mcuboot");
|
ESP_LOGD(TAG, "bootloader: mcuboot");
|
||||||
#else
|
#else
|
||||||
@@ -322,10 +325,22 @@ void DebugComponent::get_device_info_(std::string &device_info) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
auto uicr = [](volatile uint32_t *data, uint8_t size) {
|
||||||
|
std::string res;
|
||||||
|
char buf[sizeof(uint32_t) * 2 + 1];
|
||||||
|
for (size_t i = 0; i < size; i++) {
|
||||||
|
if (i > 0) {
|
||||||
|
res += ' ';
|
||||||
|
}
|
||||||
|
res += format_hex_pretty<uint32_t>(data[i], '\0', false);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
};
|
||||||
|
ESP_LOGD(TAG, "NRFFW %s", uicr(NRF_UICR->NRFFW, 13).c_str());
|
||||||
|
ESP_LOGD(TAG, "NRFHW %s", uicr(NRF_UICR->NRFHW, 12).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebugComponent::update_platform_() {}
|
void DebugComponent::update_platform_() {}
|
||||||
|
|
||||||
} // namespace debug
|
} // namespace esphome::debug
|
||||||
} // namespace esphome
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -357,8 +357,8 @@ bool MQTTClimateComponent::publish_state_() {
|
|||||||
payload = "unknown";
|
payload = "unknown";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this->device_->custom_preset.has_value())
|
if (this->device_->has_custom_preset())
|
||||||
payload = this->device_->custom_preset.value();
|
payload = this->device_->get_custom_preset();
|
||||||
if (!this->publish(this->get_preset_state_topic(), payload))
|
if (!this->publish(this->get_preset_state_topic(), payload))
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
@@ -429,8 +429,8 @@ bool MQTTClimateComponent::publish_state_() {
|
|||||||
payload = "unknown";
|
payload = "unknown";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this->device_->custom_fan_mode.has_value())
|
if (this->device_->has_custom_fan_mode())
|
||||||
payload = this->device_->custom_fan_mode.value();
|
payload = this->device_->get_custom_fan_mode();
|
||||||
if (!this->publish(this->get_fan_mode_state_topic(), payload))
|
if (!this->publish(this->get_fan_mode_state_topic(), payload))
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,23 +42,21 @@ static const LogString *sensor_type_to_string(AlarmSensorType type) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void TemplateAlarmControlPanel::dump_config() {
|
void TemplateAlarmControlPanel::dump_config() {
|
||||||
ESP_LOGCONFIG(TAG, "TemplateAlarmControlPanel:");
|
|
||||||
ESP_LOGCONFIG(TAG,
|
ESP_LOGCONFIG(TAG,
|
||||||
|
"TemplateAlarmControlPanel:\n"
|
||||||
" Current State: %s\n"
|
" Current State: %s\n"
|
||||||
" Number of Codes: %u",
|
" Number of Codes: %u\n"
|
||||||
LOG_STR_ARG(alarm_control_panel_state_to_string(this->current_state_)), this->codes_.size());
|
" Requires Code To Arm: %s\n"
|
||||||
if (!this->codes_.empty())
|
" Arming Away Time: %" PRIu32 "s\n"
|
||||||
ESP_LOGCONFIG(TAG, " Requires Code To Arm: %s", YESNO(this->requires_code_to_arm_));
|
" Arming Home Time: %" PRIu32 "s\n"
|
||||||
ESP_LOGCONFIG(TAG, " Arming Away Time: %" PRIu32 "s", (this->arming_away_time_ / 1000));
|
" Arming Night Time: %" PRIu32 "s\n"
|
||||||
if (this->arming_home_time_ != 0)
|
|
||||||
ESP_LOGCONFIG(TAG, " Arming Home Time: %" PRIu32 "s", (this->arming_home_time_ / 1000));
|
|
||||||
if (this->arming_night_time_ != 0)
|
|
||||||
ESP_LOGCONFIG(TAG, " Arming Night Time: %" PRIu32 "s", (this->arming_night_time_ / 1000));
|
|
||||||
ESP_LOGCONFIG(TAG,
|
|
||||||
" Pending Time: %" PRIu32 "s\n"
|
" Pending Time: %" PRIu32 "s\n"
|
||||||
" Trigger Time: %" PRIu32 "s\n"
|
" Trigger Time: %" PRIu32 "s\n"
|
||||||
" Supported Features: %" PRIu32,
|
" Supported Features: %" PRIu32,
|
||||||
(this->pending_time_ / 1000), (this->trigger_time_ / 1000), this->get_supported_features());
|
LOG_STR_ARG(alarm_control_panel_state_to_string(this->current_state_)), this->codes_.size(),
|
||||||
|
YESNO(!this->codes_.empty() && this->requires_code_to_arm_), (this->arming_away_time_ / 1000),
|
||||||
|
(this->arming_home_time_ / 1000), (this->arming_night_time_ / 1000), (this->pending_time_ / 1000),
|
||||||
|
(this->trigger_time_ / 1000), this->get_supported_features());
|
||||||
#ifdef USE_BINARY_SENSOR
|
#ifdef USE_BINARY_SENSOR
|
||||||
for (auto const &[sensor, info] : this->sensor_map_) {
|
for (auto const &[sensor, info] : this->sensor_map_) {
|
||||||
ESP_LOGCONFIG(TAG,
|
ESP_LOGCONFIG(TAG,
|
||||||
|
|||||||
Reference in New Issue
Block a user