mirror of
https://github.com/esphome/esphome.git
synced 2026-05-13 12:00:47 +08:00
Revert "[debug] Add iram sensor for ESP32"
This reverts commit 07b129a58a.
This commit is contained in:
@@ -45,7 +45,6 @@ class DebugComponent : public PollingComponent {
|
||||
void set_loop_time_sensor(sensor::Sensor *loop_time_sensor) { loop_time_sensor_ = loop_time_sensor; }
|
||||
#ifdef USE_ESP32
|
||||
void set_psram_sensor(sensor::Sensor *psram_sensor) { this->psram_sensor_ = psram_sensor; }
|
||||
void set_iram_sensor(sensor::Sensor *iram_sensor) { this->iram_sensor_ = iram_sensor; }
|
||||
#endif // USE_ESP32
|
||||
void set_cpu_frequency_sensor(sensor::Sensor *cpu_frequency_sensor) {
|
||||
this->cpu_frequency_sensor_ = cpu_frequency_sensor;
|
||||
@@ -72,7 +71,6 @@ class DebugComponent : public PollingComponent {
|
||||
sensor::Sensor *loop_time_sensor_{nullptr};
|
||||
#ifdef USE_ESP32
|
||||
sensor::Sensor *psram_sensor_{nullptr};
|
||||
sensor::Sensor *iram_sensor_{nullptr};
|
||||
#endif // USE_ESP32
|
||||
sensor::Sensor *cpu_frequency_sensor_{nullptr};
|
||||
#endif // USE_SENSOR
|
||||
|
||||
@@ -301,9 +301,6 @@ void DebugComponent::update_platform_() {
|
||||
if (this->psram_sensor_ != nullptr) {
|
||||
this->psram_sensor_->publish_state(heap_caps_get_free_size(MALLOC_CAP_SPIRAM));
|
||||
}
|
||||
if (this->iram_sensor_ != nullptr) {
|
||||
this->iram_sensor_->publish_state(heap_caps_get_free_size(MALLOC_CAP_IRAM_8BIT));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ DEPENDENCIES = ["debug"]
|
||||
|
||||
CONF_MIN_FREE = "min_free"
|
||||
CONF_PSRAM = "psram"
|
||||
CONF_IRAM = "iram"
|
||||
|
||||
CONFIG_SCHEMA = {
|
||||
cv.GenerateID(CONF_DEBUG_ID): cv.use_id(DebugComponent),
|
||||
@@ -99,16 +98,6 @@ CONFIG_SCHEMA = {
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
),
|
||||
cv.Optional(CONF_IRAM): cv.All(
|
||||
cv.only_on_esp32,
|
||||
sensor.sensor_schema(
|
||||
unit_of_measurement=UNIT_BYTES,
|
||||
icon=ICON_COUNTER,
|
||||
accuracy_decimals=0,
|
||||
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
),
|
||||
cv.Optional(CONF_CPU_FREQUENCY): cv.All(
|
||||
sensor.sensor_schema(
|
||||
unit_of_measurement=UNIT_HERTZ,
|
||||
@@ -149,10 +138,6 @@ async def to_code(config):
|
||||
sens = await sensor.new_sensor(psram_conf)
|
||||
cg.add(debug_component.set_psram_sensor(sens))
|
||||
|
||||
if iram_conf := config.get(CONF_IRAM):
|
||||
sens = await sensor.new_sensor(iram_conf)
|
||||
cg.add(debug_component.set_iram_sensor(sens))
|
||||
|
||||
if cpu_freq_conf := config.get(CONF_CPU_FREQUENCY):
|
||||
sens = await sensor.new_sensor(cpu_freq_conf)
|
||||
cg.add(debug_component.set_cpu_frequency_sensor(sens))
|
||||
|
||||
@@ -9,5 +9,3 @@ sensor:
|
||||
name: "Heap Fragmentation"
|
||||
min_free:
|
||||
name: "Heap Min Free"
|
||||
iram:
|
||||
name: "Free IRAM"
|
||||
|
||||
@@ -13,7 +13,5 @@ sensor:
|
||||
name: "Heap Fragmentation"
|
||||
min_free:
|
||||
name: "Heap Min Free"
|
||||
iram:
|
||||
name: "Free IRAM"
|
||||
|
||||
psram:
|
||||
|
||||
@@ -6,5 +6,3 @@ sensor:
|
||||
name: "Heap Fragmentation"
|
||||
min_free:
|
||||
name: "Heap Min Free"
|
||||
iram:
|
||||
name: "Free IRAM"
|
||||
|
||||
Reference in New Issue
Block a user