Compare commits

...

7 Commits

Author SHA1 Message Date
Jesse Hills
2f78c4acfa Merge pull request #4778 from esphome/bump-2023.4.4
2023.4.4
2023-05-04 11:31:40 +12:00
Jesse Hills
72f6841aac Bump version to 2023.4.4 2023-05-04 10:53:06 +12:00
Tim Niemueller
10bd9b14fc Fixes for Arduino 2.7.4 (for FastLED) (#4777) 2023-05-04 10:53:05 +12:00
Jesse Hills
e725e15f7a Merge pull request #4769 from esphome/bump-2023.4.3
2023.4.3
2023-05-02 17:28:32 +12:00
Jesse Hills
4d1113e265 Bump version to 2023.4.3 2023-05-02 17:10:46 +12:00
Jesse Hills
52352ac27a Fix i2s media player on devices with no internal DAC (#4768) 2023-05-02 17:10:46 +12:00
Keith Burzinski
f60b2b754d Fix sprinkler switch restore_mode (#4756) 2023-05-02 17:10:46 +12:00
8 changed files with 45 additions and 12 deletions

View File

@@ -141,7 +141,7 @@ void I2SAudioMediaPlayer::start_() {
this->audio_ = make_unique<Audio>(true, this->internal_dac_mode_, this->parent_->get_port());
} else {
#endif
this->audio_ = make_unique<Audio>(false, I2S_DAC_CHANNEL_BOTH_EN, this->parent_->get_port());
this->audio_ = make_unique<Audio>(false, 3, this->parent_->get_port());
i2s_pin_config_t pin_config = this->parent_->get_pin_config();
pin_config.data_out_num = this->dout_pin_;

View File

@@ -7,6 +7,8 @@
namespace esphome {
namespace socket {
Socket::~Socket() {}
std::unique_ptr<Socket> socket_ip(int type, int protocol) {
#if LWIP_IPV6
return socket(AF_INET6, type, protocol);

View File

@@ -11,7 +11,7 @@ namespace socket {
class Socket {
public:
Socket() = default;
virtual ~Socket() = default;
virtual ~Socket();
Socket(const Socket &) = delete;
Socket &operator=(const Socket &) = delete;
@@ -34,7 +34,7 @@ class Socket {
virtual ssize_t readv(const struct iovec *iov, int iovcnt) = 0;
virtual ssize_t write(const void *buf, size_t len) = 0;
virtual ssize_t writev(const struct iovec *iov, int iovcnt) = 0;
virtual ssize_t sendto(const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen);
virtual ssize_t sendto(const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen) = 0;
virtual int setblocking(bool blocking) = 0;
virtual int loop() { return 0; };

View File

@@ -286,7 +286,9 @@ SPRINKLER_VALVE_SCHEMA = cv.Schema(
{
cv.Optional(CONF_ENABLE_SWITCH): cv.maybe_simple_value(
switch.switch_schema(
SprinklerControllerSwitch, entity_category=ENTITY_CATEGORY_CONFIG
SprinklerControllerSwitch,
entity_category=ENTITY_CATEGORY_CONFIG,
default_restore_mode="RESTORE_DEFAULT_OFF",
),
key=CONF_NAME,
),
@@ -333,7 +335,9 @@ SPRINKLER_CONTROLLER_SCHEMA = cv.Schema(
cv.Optional(CONF_NAME): cv.string,
cv.Optional(CONF_AUTO_ADVANCE_SWITCH): cv.maybe_simple_value(
switch.switch_schema(
SprinklerControllerSwitch, entity_category=ENTITY_CATEGORY_CONFIG
SprinklerControllerSwitch,
entity_category=ENTITY_CATEGORY_CONFIG,
default_restore_mode="RESTORE_DEFAULT_OFF",
),
key=CONF_NAME,
),
@@ -343,19 +347,25 @@ SPRINKLER_CONTROLLER_SCHEMA = cv.Schema(
),
cv.Optional(CONF_QUEUE_ENABLE_SWITCH): cv.maybe_simple_value(
switch.switch_schema(
SprinklerControllerSwitch, entity_category=ENTITY_CATEGORY_CONFIG
SprinklerControllerSwitch,
entity_category=ENTITY_CATEGORY_CONFIG,
default_restore_mode="RESTORE_DEFAULT_OFF",
),
key=CONF_NAME,
),
cv.Optional(CONF_REVERSE_SWITCH): cv.maybe_simple_value(
switch.switch_schema(
SprinklerControllerSwitch, entity_category=ENTITY_CATEGORY_CONFIG
SprinklerControllerSwitch,
entity_category=ENTITY_CATEGORY_CONFIG,
default_restore_mode="RESTORE_DEFAULT_OFF",
),
key=CONF_NAME,
),
cv.Optional(CONF_STANDBY_SWITCH): cv.maybe_simple_value(
switch.switch_schema(
SprinklerControllerSwitch, entity_category=ENTITY_CATEGORY_CONFIG
SprinklerControllerSwitch,
entity_category=ENTITY_CATEGORY_CONFIG,
default_restore_mode="RESTORE_DEFAULT_OFF",
),
key=CONF_NAME,
),

View File

@@ -1176,6 +1176,21 @@ optional<uint32_t> Sprinkler::time_remaining_current_operation() {
return nullopt;
}
bool Sprinkler::any_controller_is_active() {
if (this->state_ != IDLE) {
return true;
}
for (auto &controller : this->other_controllers_) {
if (controller != this) { // dummy check
if (controller->controller_state() != IDLE) {
return true;
}
}
}
return false;
}
SprinklerControllerSwitch *Sprinkler::control_switch(size_t valve_number) {
if (this->is_a_valid_valve(valve_number)) {
return this->valve_[valve_number].controller_switch;

View File

@@ -406,6 +406,12 @@ class Sprinkler : public Component {
/// returns the amount of time remaining in seconds for all valves remaining, including the active valve, if any
optional<uint32_t> time_remaining_current_operation();
/// returns true if this or any sprinkler controller this controller knows about is active
bool any_controller_is_active();
/// returns the current state of the sprinkler controller
SprinklerState controller_state() { return this->state_; };
/// returns a pointer to a valve's control switch object
SprinklerControllerSwitch *control_switch(size_t valve_number);
@@ -503,7 +509,6 @@ class Sprinkler : public Component {
/// callback functions for timers
void valve_selection_callback_();
void sm_timer_callback_();
void pump_stop_delay_callback_();
/// Maximum allowed queue size
const uint8_t max_queue_size_{100};

View File

@@ -1,6 +1,6 @@
"""Constants used by esphome."""
__version__ = "2023.4.2"
__version__ = "2023.4.4"
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"

View File

@@ -1,8 +1,9 @@
#pragma once
#include <string>
#include <iterator>
#include <cstring>
#include <iterator>
#include <memory>
#include <string>
#include "esphome/core/defines.h"
#ifdef USE_JSON