mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-22 13:48:29 +02:00
f34c9b33fc
* Added support for Midea IoT climate devices via UART interface (USB-dongle) * Fixed lint checks * Fixed lint checks * CODEOWNERS update * Clang-format * Clang-format * Add network device notification message support (show WiFi sign on devices) * Make wifi_signal_sensor optional component * Some optimization * Optimizations and code formatting * Fixed lint checks * Fixed lint checks * Fixed sign error * Code changes * Network notify repeat every 10 min * Added log messages * Fixed lint checks * Refactoring: MideaClimate => MideaAC * Using enums instead literals in Midea states * Enum changed to be more correct * Shrink notify frame to 32 bytes * Fixed lint checks * Change notify frame appliance type to common broadcast * Control optimization * Fixed control error * Control command now don't reset others uncontrollable properties of device * Fixed lint checks * Some optimization * on_receive callback give const Frame * Fix control * Fixes * Some minor changes * Fixed lint error * No dependency from wifi_signal sensor for stretched WiFi icon. New option: stretched_icon instead wifi_signal_id. * Fix option name * Added export of outdoor temperature as sensor value * Fixed lint errors * Fixed pylint error * Minor fix * Fix temperature overflow in some cases * Added answer on QueryNetwork command from appliance. Now don't wait for ack on 0x0D command. * Fix lint error * Added humidity setpoint optional sensor * Added boolean options 'swing_horizontal' and 'swing_both' * Added debug frame output * Added debug frame output * Fix lints error * Some debug output optimization * Fix lint check * Some code optimization: adding templates * Fix lint error * Added sensors device classes * Python code reformatted with black formatter * RX frame debug message RX frame debug message now prints before checking * Remove CRC check for receiving frames * Added experimental power usage option * Added power usage option * Fixed lint errors * Major changes. See esp-docs. * Added tests in test4.yaml * Added tests in test1.yaml * Added wifi dependency * Fix test1.yaml * Some fix :) * One more refactoring * One more refactoring * One more refactoring
31 lines
901 B
Python
31 lines
901 B
Python
import esphome.codegen as cg
|
|
import esphome.config_validation as cv
|
|
from esphome.components import uart
|
|
from esphome.const import CONF_ID
|
|
|
|
DEPENDENCIES = ["wifi", "uart"]
|
|
CODEOWNERS = ["@dudanov"]
|
|
|
|
midea_dongle_ns = cg.esphome_ns.namespace("midea_dongle")
|
|
MideaDongle = midea_dongle_ns.class_("MideaDongle", cg.Component, uart.UARTDevice)
|
|
|
|
CONF_MIDEA_DONGLE_ID = "midea_dongle_id"
|
|
CONF_STRENGTH_ICON = "strength_icon"
|
|
CONFIG_SCHEMA = (
|
|
cv.Schema(
|
|
{
|
|
cv.GenerateID(): cv.declare_id(MideaDongle),
|
|
cv.Optional(CONF_STRENGTH_ICON, default=False): cv.boolean,
|
|
}
|
|
)
|
|
.extend(cv.COMPONENT_SCHEMA)
|
|
.extend(uart.UART_DEVICE_SCHEMA)
|
|
)
|
|
|
|
|
|
def to_code(config):
|
|
var = cg.new_Pvariable(config[CONF_ID])
|
|
yield cg.register_component(var, config)
|
|
yield uart.register_uart_device(var, config)
|
|
cg.add(var.use_strength_icon(config[CONF_STRENGTH_ICON]))
|