mirror of
https://github.com/esphome/esphome.git
synced 2025-07-25 20:56:38 +00:00
Merge branch 'integration' into memory_api
This commit is contained in:
commit
f3030e35a8
@ -47,15 +47,11 @@ template<typename... Ts> class HomeAssistantServiceCallAction : public Action<Ts
|
|||||||
|
|
||||||
template<typename T> void set_service(T service) { this->service_ = service; }
|
template<typename T> void set_service(T service) { this->service_ = service; }
|
||||||
|
|
||||||
template<typename T> void add_data(std::string key, T value) {
|
template<typename T> void add_data(std::string key, T value) { this->data_.emplace_back(key, value); }
|
||||||
this->data_.push_back(TemplatableKeyValuePair<Ts...>(key, value));
|
|
||||||
}
|
|
||||||
template<typename T> void add_data_template(std::string key, T value) {
|
template<typename T> void add_data_template(std::string key, T value) {
|
||||||
this->data_template_.push_back(TemplatableKeyValuePair<Ts...>(key, value));
|
this->data_template_.emplace_back(key, value);
|
||||||
}
|
|
||||||
template<typename T> void add_variable(std::string key, T value) {
|
|
||||||
this->variables_.push_back(TemplatableKeyValuePair<Ts...>(key, value));
|
|
||||||
}
|
}
|
||||||
|
template<typename T> void add_variable(std::string key, T value) { this->variables_.emplace_back(key, value); }
|
||||||
|
|
||||||
void play(Ts... x) override {
|
void play(Ts... x) override {
|
||||||
HomeassistantServiceResponse resp;
|
HomeassistantServiceResponse resp;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
from esphome.components import esp32, i2c
|
from esphome.components import esp32, i2c
|
||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
from esphome.const import CONF_ID, CONF_SAMPLE_RATE, CONF_TEMPERATURE_OFFSET
|
from esphome.const import CONF_ID, CONF_SAMPLE_RATE, CONF_TEMPERATURE_OFFSET, Framework
|
||||||
|
|
||||||
CODEOWNERS = ["@trvrnrth"]
|
CODEOWNERS = ["@trvrnrth"]
|
||||||
DEPENDENCIES = ["i2c"]
|
DEPENDENCIES = ["i2c"]
|
||||||
@ -56,7 +56,15 @@ CONFIG_SCHEMA = cv.All(
|
|||||||
): cv.positive_time_period_minutes,
|
): cv.positive_time_period_minutes,
|
||||||
}
|
}
|
||||||
).extend(i2c.i2c_device_schema(0x76)),
|
).extend(i2c.i2c_device_schema(0x76)),
|
||||||
cv.only_with_arduino,
|
cv.only_with_framework(
|
||||||
|
frameworks=Framework.ARDUINO,
|
||||||
|
suggestions={
|
||||||
|
Framework.ESP_IDF: (
|
||||||
|
"bme68x_bsec2_i2c",
|
||||||
|
"sensor/bme68x_bsec2",
|
||||||
|
)
|
||||||
|
},
|
||||||
|
),
|
||||||
cv.Any(
|
cv.Any(
|
||||||
cv.only_on_esp8266,
|
cv.only_on_esp8266,
|
||||||
cv.All(
|
cv.All(
|
||||||
|
@ -2,7 +2,13 @@ from esphome import pins
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
from esphome.components import fastled_base
|
from esphome.components import fastled_base
|
||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
from esphome.const import CONF_CHIPSET, CONF_NUM_LEDS, CONF_PIN, CONF_RGB_ORDER
|
from esphome.const import (
|
||||||
|
CONF_CHIPSET,
|
||||||
|
CONF_NUM_LEDS,
|
||||||
|
CONF_PIN,
|
||||||
|
CONF_RGB_ORDER,
|
||||||
|
Framework,
|
||||||
|
)
|
||||||
|
|
||||||
AUTO_LOAD = ["fastled_base"]
|
AUTO_LOAD = ["fastled_base"]
|
||||||
|
|
||||||
@ -48,13 +54,22 @@ CONFIG_SCHEMA = cv.All(
|
|||||||
cv.Required(CONF_PIN): pins.internal_gpio_output_pin_number,
|
cv.Required(CONF_PIN): pins.internal_gpio_output_pin_number,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
_validate,
|
cv.only_with_framework(
|
||||||
|
frameworks=Framework.ARDUINO,
|
||||||
|
suggestions={
|
||||||
|
Framework.ESP_IDF: (
|
||||||
|
"esp32_rmt_led_strip",
|
||||||
|
"light/esp32_rmt_led_strip",
|
||||||
|
)
|
||||||
|
},
|
||||||
|
),
|
||||||
cv.require_framework_version(
|
cv.require_framework_version(
|
||||||
esp8266_arduino=cv.Version(2, 7, 4),
|
esp8266_arduino=cv.Version(2, 7, 4),
|
||||||
esp32_arduino=cv.Version(99, 0, 0),
|
esp32_arduino=cv.Version(99, 0, 0),
|
||||||
max_version=True,
|
max_version=True,
|
||||||
extra_message="Please see note on documentation for FastLED",
|
extra_message="Please see note on documentation for FastLED",
|
||||||
),
|
),
|
||||||
|
_validate,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ from esphome.const import (
|
|||||||
CONF_DATA_RATE,
|
CONF_DATA_RATE,
|
||||||
CONF_NUM_LEDS,
|
CONF_NUM_LEDS,
|
||||||
CONF_RGB_ORDER,
|
CONF_RGB_ORDER,
|
||||||
|
Framework,
|
||||||
)
|
)
|
||||||
|
|
||||||
AUTO_LOAD = ["fastled_base"]
|
AUTO_LOAD = ["fastled_base"]
|
||||||
@ -33,6 +34,15 @@ CONFIG_SCHEMA = cv.All(
|
|||||||
cv.Optional(CONF_DATA_RATE): cv.frequency,
|
cv.Optional(CONF_DATA_RATE): cv.frequency,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
cv.only_with_framework(
|
||||||
|
frameworks=Framework.ARDUINO,
|
||||||
|
suggestions={
|
||||||
|
Framework.ESP_IDF: (
|
||||||
|
"spi_led_strip",
|
||||||
|
"light/spi_led_strip",
|
||||||
|
)
|
||||||
|
},
|
||||||
|
),
|
||||||
cv.require_framework_version(
|
cv.require_framework_version(
|
||||||
esp8266_arduino=cv.Version(2, 7, 4),
|
esp8266_arduino=cv.Version(2, 7, 4),
|
||||||
esp32_arduino=cv.Version(99, 0, 0),
|
esp32_arduino=cv.Version(99, 0, 0),
|
||||||
|
@ -15,6 +15,7 @@ from esphome.const import (
|
|||||||
CONF_PIN,
|
CONF_PIN,
|
||||||
CONF_TYPE,
|
CONF_TYPE,
|
||||||
CONF_VARIANT,
|
CONF_VARIANT,
|
||||||
|
Framework,
|
||||||
)
|
)
|
||||||
from esphome.core import CORE
|
from esphome.core import CORE
|
||||||
|
|
||||||
@ -162,7 +163,15 @@ def _validate_method(value):
|
|||||||
|
|
||||||
|
|
||||||
CONFIG_SCHEMA = cv.All(
|
CONFIG_SCHEMA = cv.All(
|
||||||
cv.only_with_arduino,
|
cv.only_with_framework(
|
||||||
|
frameworks=Framework.ARDUINO,
|
||||||
|
suggestions={
|
||||||
|
Framework.ESP_IDF: (
|
||||||
|
"esp32_rmt_led_strip",
|
||||||
|
"light/esp32_rmt_led_strip",
|
||||||
|
)
|
||||||
|
},
|
||||||
|
),
|
||||||
cv.require_framework_version(
|
cv.require_framework_version(
|
||||||
esp8266_arduino=cv.Version(2, 4, 0),
|
esp8266_arduino=cv.Version(2, 4, 0),
|
||||||
esp32_arduino=cv.Version(0, 0, 0),
|
esp32_arduino=cv.Version(0, 0, 0),
|
||||||
|
@ -238,10 +238,10 @@ void VoiceAssistant::loop() {
|
|||||||
|
|
||||||
api::VoiceAssistantRequest msg;
|
api::VoiceAssistantRequest msg;
|
||||||
msg.start = true;
|
msg.start = true;
|
||||||
msg.conversation_id = this->conversation_id_;
|
msg.set_conversation_id(StringRef(this->conversation_id_));
|
||||||
msg.flags = flags;
|
msg.flags = flags;
|
||||||
msg.audio_settings = audio_settings;
|
msg.audio_settings = audio_settings;
|
||||||
msg.wake_word_phrase = this->wake_word_;
|
msg.set_wake_word_phrase(StringRef(this->wake_word_));
|
||||||
this->wake_word_ = "";
|
this->wake_word_ = "";
|
||||||
|
|
||||||
// Reset media player state tracking
|
// Reset media player state tracking
|
||||||
|
Loading…
x
Reference in New Issue
Block a user