Remove a whole bunch of deprecated/removed stuff (#1981)

This commit is contained in:
Jesse Hills 2021-07-14 14:42:16 +12:00 committed by GitHub
parent 04c3a43c17
commit 07ae8ec553
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 14 additions and 141 deletions

View file

@ -22,7 +22,6 @@ from esphome.const import (
CONF_STATE,
CONF_TIMING,
CONF_TRIGGER_ID,
CONF_FOR,
CONF_NAME,
CONF_MQTT_ID,
DEVICE_CLASS_EMPTY,
@ -372,11 +371,6 @@ BINARY_SENSOR_SCHEMA = cv.MQTT_COMPONENT_SCHEMA.extend(
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(StateTrigger),
}
),
cv.Optional(CONF_INVERTED): cv.invalid(
"The inverted binary_sensor property has been replaced by the "
"new 'invert' binary sensor filter. Please see "
"https://esphome.io/components/binary_sensor/index.html."
),
}
)
@ -455,10 +449,6 @@ async def new_binary_sensor(config):
BINARY_SENSOR_CONDITION_SCHEMA = maybe_simple_id(
{
cv.Required(CONF_ID): cv.use_id(BinarySensor),
cv.Optional(CONF_FOR): cv.invalid(
"This option has been removed in 1.13, please use the "
"'for' condition instead."
),
}
)

View file

@ -110,15 +110,12 @@ class Cover : public Nameable {
/// The current operation of the cover (idle, opening, closing).
CoverOperation current_operation{COVER_OPERATION_IDLE};
union {
/** The position of the cover from 0.0 (fully closed) to 1.0 (fully open).
*
* For binary covers this is always equals to 0.0 or 1.0 (see also COVER_OPEN and
* COVER_CLOSED constants).
*/
float position;
ESPDEPRECATED("<cover>.state is deprecated, please use .position instead") float state;
};
/// The current tilt value of the cover from 0.0 to 1.0.
float tilt{COVER_OPEN};

View file

@ -6,7 +6,6 @@ from esphome.const import (
CONF_MODE,
CONF_NUMBER,
CONF_PINS,
CONF_RUN_CYCLES,
CONF_RUN_DURATION,
CONF_SLEEP_DURATION,
CONF_WAKEUP_PIN,
@ -69,11 +68,6 @@ CONFIG_SCHEMA = cv.Schema(
}
),
),
cv.Optional(CONF_RUN_CYCLES): cv.invalid(
"The run_cycles option has been removed in 1.11.0 as "
"it was essentially the same as a run_duration of 0s."
"Please use run_duration now."
),
}
).extend(cv.COMPONENT_SCHEMA)

View file

@ -163,9 +163,6 @@ CONFIG_SCHEMA = cv.Schema(
cv.Required(CONF_MANUFACTURER_ID): bt_uuid,
}
),
cv.Optional("scan_interval"): cv.invalid(
"This option has been removed in 1.14 (Reason: " "it never had an effect)"
),
}
).extend(cv.COMPONENT_SCHEMA)

View file

@ -1,3 +0,0 @@
import esphome.config_validation as cv
CONFIG_SCHEMA = cv.invalid("This platform has been renamed to ble_presence in 1.13")

View file

@ -85,12 +85,6 @@ class ESPBTDevice {
int get_rssi() const { return rssi_; }
const std::string &get_name() const { return this->name_; }
ESPDEPRECATED("Use get_tx_powers() instead")
optional<int8_t> get_tx_power() const {
if (this->tx_powers_.empty())
return {};
return this->tx_powers_[0];
}
const std::vector<int8_t> &get_tx_powers() const { return tx_powers_; }
const optional<uint16_t> &get_appearance() const { return appearance_; }

View file

@ -85,9 +85,6 @@ CONFIG_SCHEMA = cv.All(
cv.Optional(CONF_ENABLE_MDNS, default=True): cv.boolean,
cv.Optional(CONF_DOMAIN, default=".local"): cv.domain_name,
cv.Optional(CONF_USE_ADDRESS): cv.string_strict,
cv.Optional("hostname"): cv.invalid(
"The hostname option has been removed in 1.11.0"
),
}
).extend(cv.COMPONENT_SCHEMA),
_validate,

View file

@ -3,7 +3,6 @@ from esphome.components import output
import esphome.config_validation as cv
import esphome.codegen as cg
from esphome.const import (
CONF_BIT_DEPTH,
CONF_CHANNEL,
CONF_FREQUENCY,
CONF_ID,
@ -50,10 +49,6 @@ CONFIG_SCHEMA = output.FLOAT_OUTPUT_SCHEMA.extend(
cv.Required(CONF_PIN): pins.internal_gpio_output_pin_schema,
cv.Optional(CONF_FREQUENCY, default="1kHz"): cv.frequency,
cv.Optional(CONF_CHANNEL): cv.int_range(min=0, max=15),
cv.Optional(CONF_BIT_DEPTH): cv.invalid(
"The bit_depth option has been removed in v1.14, the "
"best bit depth is now automatically calculated."
),
}
).extend(cv.COMPONENT_SCHEMA)

View file

@ -121,9 +121,6 @@ void LightState::loop() {
float LightState::get_setup_priority() const { return setup_priority::HARDWARE - 1.0f; }
uint32_t LightState::hash_base() { return 1114400283; }
LightColorValues LightState::get_current_values() { return this->current_values; }
LightColorValues LightState::get_remote_values() { return this->remote_values; }
void LightState::publish_state() {
this->remote_values_callback_.call();
this->next_write_ = true;

View file

@ -68,14 +68,6 @@ class LightState : public Nameable, public Component {
*/
LightColorValues remote_values;
/// Deprecated method to access current_values.
ESPDEPRECATED("get_current_values() is deprecated, please use .current_values instead.")
LightColorValues get_current_values();
/// Deprecated method to access remote_values.
ESPDEPRECATED("get_remote_values() is deprecated, please use .remote_values instead.")
LightColorValues get_remote_values();
/// Publish the currently active state to the frontend.
void publish_state();

View file

@ -38,21 +38,13 @@ async def to_code(config):
cg.add(var.set_pcf8575(config[CONF_PCF8575]))
def validate_pcf8574_gpio_mode(value):
value = cv.string(value)
if value.upper() == "INPUT_PULLUP":
raise cv.Invalid(
"INPUT_PULLUP mode has been removed in 1.14 and been combined into "
"INPUT mode (they were the same thing). Please use INPUT instead."
)
return cv.enum(PCF8674_GPIO_MODES, upper=True)(value)
PCF8574_OUTPUT_PIN_SCHEMA = cv.Schema(
{
cv.Required(CONF_PCF8574): cv.use_id(PCF8574Component),
cv.Required(CONF_NUMBER): cv.int_,
cv.Optional(CONF_MODE, default="OUTPUT"): validate_pcf8574_gpio_mode,
cv.Optional(CONF_MODE, default="OUTPUT"): cv.enum(
PCF8674_GPIO_MODES, upper=True
),
cv.Optional(CONF_INVERTED, default=False): cv.boolean,
}
)
@ -60,7 +52,9 @@ PCF8574_INPUT_PIN_SCHEMA = cv.Schema(
{
cv.Required(CONF_PCF8574): cv.use_id(PCF8574Component),
cv.Required(CONF_NUMBER): cv.int_,
cv.Optional(CONF_MODE, default="INPUT"): validate_pcf8574_gpio_mode,
cv.Optional(CONF_MODE, default="INPUT"): cv.enum(
PCF8674_GPIO_MODES, upper=True
),
cv.Optional(CONF_INVERTED, default=False): cv.boolean,
}
)

View file

@ -1,33 +0,0 @@
import esphome.config_validation as cv
from esphome.components.remote_base import BINARY_SENSOR_REGISTRY
from esphome.util import OrderedDict
def show_new(value):
from esphome import yaml_util
for key in BINARY_SENSOR_REGISTRY:
if key in value:
break
else:
raise cv.Invalid(
"This platform has been removed in 1.13, please see the docs for updated "
"instructions."
)
val = value[key]
args = [("platform", "template")]
if "id" in value:
args.append(("id", value["id"]))
if "name" in value:
args.append(("name", value["name"]))
args.append(("turn_on_action", {f"remote_transmitter.transmit_{key}": val}))
text = yaml_util.dump([OrderedDict(args)])
raise cv.Invalid(
"This platform has been removed in 1.13, please change to:\n\n{}\n\n."
"".format(text)
)
CONFIG_SCHEMA = show_new

View file

@ -28,7 +28,6 @@ void Sensor::publish_state(float state) {
this->filter_list_->input(state);
}
}
void Sensor::push_new_value(float state) { this->publish_state(state); }
std::string Sensor::unit_of_measurement() { return ""; }
std::string Sensor::icon() { return ""; }
uint32_t Sensor::update_interval() { return 0; }
@ -104,9 +103,7 @@ void Sensor::clear_filters() {
}
this->filter_list_ = nullptr;
}
float Sensor::get_value() const { return this->state; }
float Sensor::get_state() const { return this->state; }
float Sensor::get_raw_value() const { return this->raw_state; }
float Sensor::get_raw_state() const { return this->raw_state; }
std::string Sensor::unique_id() { return ""; }

View file

@ -87,12 +87,8 @@ class Sensor : public Nameable {
/// Clear the entire filter chain.
void clear_filters();
/// Getter-syntax for .value. Please use .state instead.
float get_value() const ESPDEPRECATED(".value is deprecated, please use .state");
/// Getter-syntax for .state.
float get_state() const;
/// Getter-syntax for .raw_value. Please use .raw_state instead.
float get_raw_value() const ESPDEPRECATED(".raw_value is deprecated, please use .raw_state");
/// Getter-syntax for .raw_state
float get_raw_state() const;
@ -114,12 +110,6 @@ class Sensor : public Nameable {
*/
void publish_state(float state);
/** Push a new value to the MQTT front-end.
*
* Note: deprecated, please use publish_state.
*/
void push_new_value(float state) ESPDEPRECATED("push_new_value is deprecated. Please use .publish_state instead");
// ========== INTERNAL METHODS ==========
// (In most use cases you won't need these)
/// Add a callback that will be called every time a filtered value arrives.

View file

@ -32,11 +32,8 @@ struct ESPTime {
uint16_t year;
/// daylight saving time flag
bool is_dst;
union {
ESPDEPRECATED(".time is deprecated, use .timestamp instead") time_t time;
/// unix epoch time (seconds since UTC Midnight January 1, 1970)
time_t timestamp;
};
/** Convert this ESPTime struct to a null-terminated c string buffer as specified by the format argument.
* Up to buffer_len bytes are written.

View file

@ -37,13 +37,6 @@ CONFIG_SCHEMA = (
cv.Optional(
CONF_PULSE_TIME, default="10us"
): cv.positive_time_period_microseconds,
cv.Optional("timeout_meter"): cv.invalid(
"The timeout_meter option has been renamed " "to 'timeout' in 1.12."
),
cv.Optional("timeout_time"): cv.invalid(
"The timeout_time option has been removed. Please "
"use 'timeout' in 1.12."
),
}
)
.extend(cv.polling_component_schema("60s"))

View file

@ -249,9 +249,6 @@ CONFIG_SCHEMA = cv.All(
cv.SplitDefault(CONF_OUTPUT_POWER, esp8266=20.0): cv.All(
cv.decibel, cv.float_range(min=10.0, max=20.5)
),
cv.Optional("hostname"): cv.invalid(
"The hostname option has been removed in 1.11.0"
),
}
),
_validate,

View file

@ -1,3 +0,0 @@
import esphome.config_validation as cv
CONFIG_SCHEMA = cv.invalid("This sensor has been renamed to xiaomi_hhccjcy01")

View file

@ -1,3 +0,0 @@
import esphome.config_validation as cv
CONFIG_SCHEMA = cv.invalid("This sensor has been renamed to xiaomi_lywsdcgq")

View file

@ -501,7 +501,6 @@ CONF_ROTATION = "rotation"
CONF_RS_PIN = "rs_pin"
CONF_RTD_NOMINAL_RESISTANCE = "rtd_nominal_resistance"
CONF_RTD_WIRES = "rtd_wires"
CONF_RUN_CYCLES = "run_cycles"
CONF_RUN_DURATION = "run_duration"
CONF_RW_PIN = "rw_pin"
CONF_RX_BUFFER_SIZE = "rx_buffer_size"

View file

@ -201,11 +201,6 @@ CONFIG_SCHEMA = cv.Schema(
cv.Required(CONF_VERSION): cv.string_strict,
}
),
cv.Optional("esphome_core_version"): cv.invalid(
"The esphome_core_version option has been "
"removed in 1.13 - the esphome core source "
"files are now bundled with ESPHome."
),
}
)