Compare commits

..

14 Commits

Author SHA1 Message Date
Jesse Hills
69fe18f1ef Fix small index compare bug in modbus 2022-12-16 16:21:04 +13:00
Jesse Hills
39af967433 Fix i2s_audio media_player compiling for esp32-s2 (#4195) 2022-12-16 10:38:52 +13:00
Jesse Hills
83b5e01a28 Mark ESP32-S2 as not having Bluetooth (#4194) 2022-12-16 10:09:07 +13:00
Stefan Agner
1eacbd50fa Support non-multiarch toolchains on 32-bit ARM (#4191)
fixes https://github.com/esphome/issues/issues/3904
2022-12-16 09:27:59 +13:00
Jesse Hills
9bf7c97775 Revert camera config change for esp-idf (#4182) 2022-12-14 11:45:51 +13:00
Jesse Hills
24bf3674f3 Remove warnings when falling through switch cases on purpose (#4181) 2022-12-14 11:45:43 +13:00
J. Nick Koston
c47dc09d34 Speed up bluetooth proxy connections when using esp-idf (#4171) 2022-12-13 13:57:12 +13:00
Jesse Hills
db3096c6e1 Remove internal pin restriction from cd74hc4067 (#4179) 2022-12-13 13:44:52 +13:00
Jesse Hills
eef578f4b8 Bump esphome-dashboard to 20221213.0 (#4176) 2022-12-13 08:14:18 +13:00
Jesse Hills
d4e232f267 Increase watchdog timeout when starting OTA (#4172) 2022-12-12 16:16:24 +13:00
Björn Stenberg
cc45945fcf climate: Add features to generic Toshiba model (#3912)
Add fan speed modes, dry and fan-only operation modes.
This reduce differences between generic and PT14111 models.
2022-12-08 14:13:10 -06:00
Jesse Hills
0c24d951ff Fix ble parsing with zero padded advertisements (#4162) 2022-12-08 13:39:33 +13:00
John Britton
92e44b8238 Expose lambda action to reset a cycle in slow_pwm (#4158) 2022-12-07 19:27:14 +13:00
Jesse Hills
34387adbcd Bump version to 2023.1.0-dev 2022-12-07 17:00:11 +13:00
9 changed files with 51 additions and 44 deletions

View File

@@ -4,7 +4,7 @@ import requests
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components.packages import validate_source_shorthand
from esphome.const import CONF_WIFI, CONF_REF
from esphome.const import CONF_WIFI
from esphome.wizard import wizard_file
from esphome.yaml_util import dump
from esphome import git
@@ -21,32 +21,19 @@ CODEOWNERS = ["@esphome/core"]
def validate_import_url(value):
value = cv.string_strict(value)
value = cv.Length(max=255)(value)
# ignore result, only check if it's a valid shorthand
validate_source_shorthand(value)
return value
def validate_full_url(config):
if not config[CONF_IMPORT_FULL_CONFIG]:
return config
source = validate_source_shorthand(config[CONF_PACKAGE_IMPORT_URL])
if CONF_REF not in source:
raise cv.Invalid(
"Must specify a ref (branch or tag) to import from when importing full config"
)
return config
CONF_PACKAGE_IMPORT_URL = "package_import_url"
CONF_IMPORT_FULL_CONFIG = "import_full_config"
CONFIG_SCHEMA = cv.All(
cv.Schema(
{
cv.Required(CONF_PACKAGE_IMPORT_URL): validate_import_url,
cv.Optional(CONF_IMPORT_FULL_CONFIG, default=False): cv.boolean,
}
),
validate_full_url,
CONFIG_SCHEMA = cv.Schema(
{
cv.Required(CONF_PACKAGE_IMPORT_URL): validate_import_url,
cv.Optional(CONF_IMPORT_FULL_CONFIG, default=False): cv.boolean,
}
)
WIFI_CONFIG = """
@@ -62,7 +49,7 @@ async def to_code(config):
url = config[CONF_PACKAGE_IMPORT_URL]
if config[CONF_IMPORT_FULL_CONFIG]:
url += "?full_config"
cg.add(dashboard_import_ns.set_package_import_url(url))
cg.add(dashboard_import_ns.set_package_import_url(config[CONF_PACKAGE_IMPORT_URL]))
def import_config(

View File

@@ -706,7 +706,11 @@ void ESPBTDevice::parse_adv_(const esp_ble_gap_cb_param_t::ble_scan_result_evt_p
while (offset + 2 < len) {
const uint8_t field_length = payload[offset++]; // First byte is length of adv record
if (field_length == 0) {
continue; // Possible zero padded advertisement data
if (offset < param.adv_data_len && param.scan_rsp_len > 0) { // Zero padded advertisement data
offset = param.adv_data_len;
continue;
}
break;
}
// first byte of adv record is adv record type

View File

@@ -47,7 +47,7 @@ bool Modbus::parse_modbus_byte_(uint8_t byte) {
uint8_t function_code = raw[1];
// Byte 2: Size (with modbus rtu function code 4/3)
// See also https://en.wikipedia.org/wiki/Modbus
if (at == 2)
if (at <= 2)
return true;
uint8_t data_len = raw[2];

View File

@@ -70,7 +70,7 @@ void SlowPWMOutput::dump_config() {
void SlowPWMOutput::write_state(float state) {
this->state_ = state;
if (this->restart_cycle_on_state_change_)
this->period_start_time_ = millis();
this->restart_cycle();
}
} // namespace slow_pwm

View File

@@ -14,6 +14,7 @@ class SlowPWMOutput : public output::FloatOutput, public Component {
void set_restart_cycle_on_state_change(bool restart_cycle_on_state_change) {
restart_cycle_on_state_change_ = restart_cycle_on_state_change;
}
void restart_cycle() { this->period_start_time_ = millis(); }
/// Initialize pin
void setup() override;

View File

@@ -124,9 +124,6 @@ void ToshibaClimate::setup() {
// Set supported modes & temperatures based on model
this->minimum_temperature_ = this->temperature_min_();
this->maximum_temperature_ = this->temperature_max_();
this->supports_dry_ = this->toshiba_supports_dry_();
this->supports_fan_only_ = this->toshiba_supports_fan_only_();
this->fan_modes_ = this->toshiba_fan_modes_();
this->swing_modes_ = this->toshiba_swing_modes_();
// Never send nan to HA
if (std::isnan(this->target_temperature))
@@ -178,12 +175,39 @@ void ToshibaClimate::transmit_generic_() {
mode = TOSHIBA_MODE_COOL;
break;
case climate::CLIMATE_MODE_DRY:
mode = TOSHIBA_MODE_DRY;
break;
case climate::CLIMATE_MODE_FAN_ONLY:
mode = TOSHIBA_MODE_FAN_ONLY;
break;
case climate::CLIMATE_MODE_HEAT_COOL:
default:
mode = TOSHIBA_MODE_AUTO;
}
message[6] |= mode | TOSHIBA_FAN_SPEED_AUTO;
uint8_t fan;
switch (this->fan_mode.value()) {
case climate::CLIMATE_FAN_LOW:
fan = TOSHIBA_FAN_SPEED_1;
break;
case climate::CLIMATE_FAN_MEDIUM:
fan = TOSHIBA_FAN_SPEED_3;
break;
case climate::CLIMATE_FAN_HIGH:
fan = TOSHIBA_FAN_SPEED_5;
break;
case climate::CLIMATE_FAN_AUTO:
default:
fan = TOSHIBA_FAN_SPEED_AUTO;
break;
}
message[6] = fan | mode;
// Zero
message[7] = 0x00;

View File

@@ -22,7 +22,10 @@ const float TOSHIBA_RAC_PT1411HWRU_TEMP_F_MAX = 86.0;
class ToshibaClimate : public climate_ir::ClimateIR {
public:
ToshibaClimate() : climate_ir::ClimateIR(TOSHIBA_GENERIC_TEMP_C_MIN, TOSHIBA_GENERIC_TEMP_C_MAX, 1.0f) {}
ToshibaClimate()
: climate_ir::ClimateIR(TOSHIBA_GENERIC_TEMP_C_MIN, TOSHIBA_GENERIC_TEMP_C_MAX, 1.0f, true, true,
{climate::CLIMATE_FAN_AUTO, climate::CLIMATE_FAN_LOW, climate::CLIMATE_FAN_MEDIUM,
climate::CLIMATE_FAN_HIGH}) {}
void setup() override;
void set_model(Model model) { this->model_ = model; }
@@ -46,18 +49,6 @@ class ToshibaClimate : public climate_ir::ClimateIR {
float temperature_max_() {
return (this->model_ == MODEL_GENERIC) ? TOSHIBA_GENERIC_TEMP_C_MAX : TOSHIBA_RAC_PT1411HWRU_TEMP_C_MAX;
}
bool toshiba_supports_dry_() {
return ((this->model_ == MODEL_RAC_PT1411HWRU_C) || (this->model_ == MODEL_RAC_PT1411HWRU_F));
}
bool toshiba_supports_fan_only_() {
return ((this->model_ == MODEL_RAC_PT1411HWRU_C) || (this->model_ == MODEL_RAC_PT1411HWRU_F));
}
std::set<climate::ClimateFanMode> toshiba_fan_modes_() {
return (this->model_ == MODEL_GENERIC)
? std::set<climate::ClimateFanMode>{}
: std::set<climate::ClimateFanMode>{climate::CLIMATE_FAN_AUTO, climate::CLIMATE_FAN_LOW,
climate::CLIMATE_FAN_MEDIUM, climate::CLIMATE_FAN_HIGH};
}
std::set<climate::ClimateSwingMode> toshiba_swing_modes_() {
return (this->model_ == MODEL_GENERIC)
? std::set<climate::ClimateSwingMode>{}

View File

@@ -1,6 +1,6 @@
"""Constants used by esphome."""
__version__ = "2022.12.2"
__version__ = "2023.1.0-dev"
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"

View File

@@ -129,9 +129,9 @@ class GitFile:
def raw_url(self) -> str:
if self.ref is None:
raise ValueError("URL has no ref")
if self.domain == "github.com":
if self.domain == "github":
return f"https://raw.githubusercontent.com/{self.owner}/{self.repo}/{self.ref}/{self.filename}"
if self.domain == "gitlab.com":
if self.domain == "gitlab":
return f"https://gitlab.com/{self.owner}/{self.repo}/-/raw/{self.ref}/{self.filename}"
raise NotImplementedError(f"Git domain {self.domain} not supported")