Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszduda23 authored Jun 8, 2023
2 parents 3bae698 + 1cf210f commit 901d4aa
Show file tree
Hide file tree
Showing 38 changed files with 564 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Run yamllint
uses: frenck/[email protected].0
uses: frenck/[email protected].1

black:
name: Check black
Expand Down
2 changes: 2 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ RUN \
git=1:2.30.2-1+deb11u2 \
curl=7.74.0-1.3+deb11u7 \
openssh-client=1:8.4p1-5+deb11u1 \
libcairo2=1.16.0-5 \
python3-cffi=1.14.5-1 \
&& rm -rf \
/tmp/* \
/var/{cache,log}/* \
Expand Down
2 changes: 1 addition & 1 deletion esphome/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ def run_esphome(argv):
_LOGGER.error(e, exc_info=args.verbose)
return 1

safe_print(f"ESPHome {const.__version__}")
_LOGGER.info("ESPHome %s", const.__version__)

for conf_path in args.configuration:
if any(os.path.basename(conf_path) == x for x in SECRETS_FILES):
Expand Down
1 change: 1 addition & 0 deletions esphome/components/api/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,7 @@ message VoiceAssistantRequest {
option (ifdef) = "USE_VOICE_ASSISTANT";

bool start = 1;
string conversation_id = 2;
}

message VoiceAssistantResponse {
Expand Down
3 changes: 2 additions & 1 deletion esphome/components/api/api_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -895,11 +895,12 @@ BluetoothConnectionsFreeResponse APIConnection::subscribe_bluetooth_connections_
#endif

#ifdef USE_VOICE_ASSISTANT
bool APIConnection::request_voice_assistant(bool start) {
bool APIConnection::request_voice_assistant(bool start, const std::string &conversation_id) {
if (!this->voice_assistant_subscription_)
return false;
VoiceAssistantRequest msg;
msg.start = start;
msg.conversation_id = conversation_id;
return this->send_voice_assistant_request(msg);
}
void APIConnection::on_voice_assistant_response(const VoiceAssistantResponse &msg) {
Expand Down
2 changes: 1 addition & 1 deletion esphome/components/api/api_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class APIConnection : public APIServerConnection {
void subscribe_voice_assistant(const SubscribeVoiceAssistantRequest &msg) override {
this->voice_assistant_subscription_ = msg.subscribe;
}
bool request_voice_assistant(bool start);
bool request_voice_assistant(bool start, const std::string &conversation_id);
void on_voice_assistant_response(const VoiceAssistantResponse &msg) override;
void on_voice_assistant_event_response(const VoiceAssistantEventResponse &msg) override;
#endif
Expand Down
19 changes: 18 additions & 1 deletion esphome/components/api/api_pb2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6187,14 +6187,31 @@ bool VoiceAssistantRequest::decode_varint(uint32_t field_id, ProtoVarInt value)
return false;
}
}
void VoiceAssistantRequest::encode(ProtoWriteBuffer buffer) const { buffer.encode_bool(1, this->start); }
bool VoiceAssistantRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
switch (field_id) {
case 2: {
this->conversation_id = value.as_string();
return true;
}
default:
return false;
}
}
void VoiceAssistantRequest::encode(ProtoWriteBuffer buffer) const {
buffer.encode_bool(1, this->start);
buffer.encode_string(2, this->conversation_id);
}
#ifdef HAS_PROTO_MESSAGE_DUMP
void VoiceAssistantRequest::dump_to(std::string &out) const {
__attribute__((unused)) char buffer[64];
out.append("VoiceAssistantRequest {\n");
out.append(" start: ");
out.append(YESNO(this->start));
out.append("\n");

out.append(" conversation_id: ");
out.append("'").append(this->conversation_id).append("'");
out.append("\n");
out.append("}");
}
#endif
Expand Down
2 changes: 2 additions & 0 deletions esphome/components/api/api_pb2.h
Original file line number Diff line number Diff line change
Expand Up @@ -1604,12 +1604,14 @@ class SubscribeVoiceAssistantRequest : public ProtoMessage {
class VoiceAssistantRequest : public ProtoMessage {
public:
bool start{false};
std::string conversation_id{};
void encode(ProtoWriteBuffer buffer) const override;
#ifdef HAS_PROTO_MESSAGE_DUMP
void dump_to(std::string &out) const override;
#endif

protected:
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
};
class VoiceAssistantResponse : public ProtoMessage {
Expand Down
6 changes: 3 additions & 3 deletions esphome/components/api/api_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,16 +428,16 @@ void APIServer::on_shutdown() {
}

#ifdef USE_VOICE_ASSISTANT
bool APIServer::start_voice_assistant() {
bool APIServer::start_voice_assistant(const std::string &conversation_id) {
for (auto &c : this->clients_) {
if (c->request_voice_assistant(true))
if (c->request_voice_assistant(true, conversation_id))
return true;
}
return false;
}
void APIServer::stop_voice_assistant() {
for (auto &c : this->clients_) {
if (c->request_voice_assistant(false))
if (c->request_voice_assistant(false, ""))
return;
}
}
Expand Down
2 changes: 1 addition & 1 deletion esphome/components/api/api_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class APIServer : public Component, public Controller {
#endif

#ifdef USE_VOICE_ASSISTANT
bool start_voice_assistant();
bool start_voice_assistant(const std::string &conversation_id);
void stop_voice_assistant();
#endif

Expand Down
33 changes: 33 additions & 0 deletions esphome/components/esp32/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,39 @@
}

ESP32_BOARD_PINS = {
"adafruit_feather_esp32s2_tft": {
"BUTTON": 0,
"A0": 18,
"A1": 17,
"A2": 16,
"A3": 15,
"A4": 14,
"A5": 8,
"SCK": 36,
"MOSI": 35,
"MISO": 37,
"RX": 2,
"TX": 1,
"D13": 13,
"D12": 12,
"D11": 11,
"D10": 10,
"D9": 9,
"D6": 6,
"D5": 5,
"NEOPIXEL": 33,
"PIN_NEOPIXEL": 33,
"NEOPIXEL_POWER": 34,
"SCL": 41,
"SDA": 42,
"TFT_I2C_POWER": 21,
"TFT_CS": 7,
"TFT_DC": 39,
"TFT_RESET": 40,
"TFT_BACKLIGHT": 45,
"LED": 13,
"LED_BUILTIN": 13,
},
"adafruit_qtpy_esp32c3": {
"A0": 4,
"A1": 3,
Expand Down
3 changes: 2 additions & 1 deletion esphome/components/esp32_rmt_led_strip/led_strip.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <cinttypes>
#include "led_strip.h"

#ifdef USE_ESP32
Expand Down Expand Up @@ -195,7 +196,7 @@ void ESP32RMTLEDStripLightOutput::dump_config() {
break;
}
ESP_LOGCONFIG(TAG, " RGB Order: %s", rgb_order);
ESP_LOGCONFIG(TAG, " Max refresh rate: %u", *this->max_refresh_rate_);
ESP_LOGCONFIG(TAG, " Max refresh rate: %" PRIu32, *this->max_refresh_rate_);
ESP_LOGCONFIG(TAG, " Number of LEDs: %u", this->num_leds_);
}

Expand Down
2 changes: 1 addition & 1 deletion esphome/components/i2s_audio/microphone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def validate_esp32_variant(config):
cv.GenerateID(): cv.declare_id(I2SAudioMicrophone),
cv.GenerateID(CONF_I2S_AUDIO_ID): cv.use_id(I2SAudioComponent),
cv.Optional(CONF_CHANNEL, default="right"): cv.enum(CHANNELS),
cv.Optional(CONF_BITS_PER_SAMPLE, default="16bit"): cv.All(
cv.Optional(CONF_BITS_PER_SAMPLE, default="32bit"): cv.All(
_validate_bits, cv.enum(BITS_PER_SAMPLE)
),
}
Expand Down
Loading

0 comments on commit 901d4aa

Please sign in to comment.