diff --git a/components/panasonic_heatpump/__init__.py b/components/panasonic_heatpump/__init__.py index 3473a79..d94e32b 100644 --- a/components/panasonic_heatpump/__init__.py +++ b/components/panasonic_heatpump/__init__.py @@ -3,16 +3,14 @@ import esphome.config_validation as cv from esphome.components import uart from esphome.const import CONF_ID - CODEOWNERS = ["@elvit"] -MULTICONF = True DEPENDENCIES = ["uart"] +MULTICONF = True CONF_PANASONIC_HEATPUMP_ID = "panasonic_heatpump" CONF_UART_CLIENT = "uart_client_id" CONF_LOG_UART_MSG = "log_uart_msg" - panasonic_heatpump_ns = cg.esphome_ns.namespace("panasonic_heatpump") PanasonicHeatpumpComponent = panasonic_heatpump_ns.class_( "PanasonicHeatpumpComponent", cg.PollingComponent, uart.UARTDevice diff --git a/components/panasonic_heatpump/binary_sensor/__init__.py b/components/panasonic_heatpump/binary_sensor/__init__.py index 2cf4603..67b4cc8 100644 --- a/components/panasonic_heatpump/binary_sensor/__init__.py +++ b/components/panasonic_heatpump/binary_sensor/__init__.py @@ -10,7 +10,6 @@ from .. import ( panasonic_heatpump_ns, ) - CONF_TOP0 = "top0" # Heatpump State CONF_TOP2 = "top2" # Force DHW State CONF_TOP3 = "top3" # Quiet Mode Schedule @@ -152,7 +151,6 @@ CONFIG_SCHEMA = cv.Schema( } ).extend(cv.COMPONENT_SCHEMA) - async def to_code(config): parent = await cg.get_variable(config[CONF_PANASONIC_HEATPUMP_ID]) for index, key in enumerate(TYPES): diff --git a/components/panasonic_heatpump/climate/__init__.py b/components/panasonic_heatpump/climate/__init__.py index 06093d9..9ac4534 100644 --- a/components/panasonic_heatpump/climate/__init__.py +++ b/components/panasonic_heatpump/climate/__init__.py @@ -27,7 +27,6 @@ TYPES = [ CONF_CLIMATE_ZONE2, ] - def climate_options(min_temp, max_temp, temp_step) -> cv.Schema: schema = cv.Schema( { @@ -61,7 +60,6 @@ CONFIG_SCHEMA = cv.Schema( } ).extend(cv.COMPONENT_SCHEMA) - async def to_code(config): parent = await cg.get_variable(config[CONF_PANASONIC_HEATPUMP_ID]) for index, key in enumerate(TYPES): diff --git a/components/panasonic_heatpump/number/__init__.py b/components/panasonic_heatpump/number/__init__.py index 04b92a9..774d485 100644 --- a/components/panasonic_heatpump/number/__init__.py +++ b/components/panasonic_heatpump/number/__init__.py @@ -16,7 +16,6 @@ from .. import ( panasonic_heatpump_ns, ) - CONF_SET5 = "set5" # Set Z1 Heat Request Temperature CONF_SET6 = "set6" # Set Z1 Cool Request Temperature CONF_SET7 = "set7" # Set Z2 Heat Request Temperature @@ -87,7 +86,6 @@ TYPES = [ CONF_SET38, ] - def number_options(min_val, max_val, step) -> cv.Schema: schema = cv.Schema( { @@ -98,7 +96,6 @@ def number_options(min_val, max_val, step) -> cv.Schema: ) return schema - PanasonicHeatpumpNumber = panasonic_heatpump_ns.class_( "PanasonicHeatpumpNumber", number.Number, cg.Component ) @@ -258,7 +255,6 @@ CONFIG_SCHEMA = cv.Schema( } ).extend(cv.COMPONENT_SCHEMA) - async def to_code(config): parent = await cg.get_variable(config[CONF_PANASONIC_HEATPUMP_ID]) for index, key in enumerate(TYPES): diff --git a/components/panasonic_heatpump/panasonic_heatpump.cpp b/components/panasonic_heatpump/panasonic_heatpump.cpp index 1fc6126..ed038a0 100644 --- a/components/panasonic_heatpump/panasonic_heatpump.cpp +++ b/components/panasonic_heatpump/panasonic_heatpump.cpp @@ -6,7 +6,7 @@ namespace panasonic_heatpump { static const char* const TAG = "panasonic_heatpump"; void PanasonicHeatpumpComponent::dump_config() { - ESP_LOGW(TAG, "*** Panasonic Heatpump Component v0.0.4 ***"); + ESP_LOGW(TAG, "*** Panasonic Heatpump Component v%s ***", PanasonicHeatpumpComponent::PANASONIC_HEATPUMP_VERSION); delay(10); // NOLINT } diff --git a/components/panasonic_heatpump/panasonic_heatpump.h b/components/panasonic_heatpump/panasonic_heatpump.h index 1d9d65b..f3364fa 100644 --- a/components/panasonic_heatpump/panasonic_heatpump.h +++ b/components/panasonic_heatpump/panasonic_heatpump.h @@ -11,6 +11,8 @@ #include "decode.h" #include "commands.h" +#define PANASONIC_HEATPUMP_VERSION "0.0.5" + namespace esphome { namespace panasonic_heatpump { enum LoopState : uint8_t { diff --git a/components/panasonic_heatpump/select/__init__.py b/components/panasonic_heatpump/select/__init__.py index aa2c5c4..386fd49 100644 --- a/components/panasonic_heatpump/select/__init__.py +++ b/components/panasonic_heatpump/select/__init__.py @@ -10,7 +10,6 @@ from .. import ( panasonic_heatpump_ns, ) - CONF_COOL_MODE = "cool_mode" CONF_SET2 = "set2" # Set Holiday Mode CONF_SET3 = "set3" # Set Quiet Mode @@ -62,6 +61,7 @@ CONF_SELECTS = [ ["Disabled", "Type-A", "Type-B"], ["Alternative", "Parallel", "Advanced Parallel"], ] + CONF_SELECT_COOL_MODE = [ "TANK", "HEAT", @@ -106,7 +106,6 @@ CONFIG_SCHEMA = cv.Schema( } ).extend(cv.COMPONENT_SCHEMA) - async def to_code(config): parent = await cg.get_variable(config[CONF_PANASONIC_HEATPUMP_ID]) for index, key in enumerate(TYPES): diff --git a/components/panasonic_heatpump/sensor/__init__.py b/components/panasonic_heatpump/sensor/__init__.py index 6012670..0c17033 100644 --- a/components/panasonic_heatpump/sensor/__init__.py +++ b/components/panasonic_heatpump/sensor/__init__.py @@ -955,7 +955,6 @@ CONFIG_SCHEMA = cv.Schema( } ).extend(cv.COMPONENT_SCHEMA) - async def to_code(config): parent = await cg.get_variable(config[CONF_PANASONIC_HEATPUMP_ID]) for index, key in enumerate(TYPES): diff --git a/components/panasonic_heatpump/switch/__init__.py b/components/panasonic_heatpump/switch/__init__.py index 7b5f4c9..ba04612 100644 --- a/components/panasonic_heatpump/switch/__init__.py +++ b/components/panasonic_heatpump/switch/__init__.py @@ -91,7 +91,6 @@ CONFIG_SCHEMA = cv.Schema( } ).extend(cv.COMPONENT_SCHEMA) - async def to_code(config): parent = await cg.get_variable(config[CONF_PANASONIC_HEATPUMP_ID]) for index, key in enumerate(TYPES): diff --git a/components/panasonic_heatpump/text_sensor/__init__.py b/components/panasonic_heatpump/text_sensor/__init__.py index 38fed84..bff2027 100644 --- a/components/panasonic_heatpump/text_sensor/__init__.py +++ b/components/panasonic_heatpump/text_sensor/__init__.py @@ -166,7 +166,6 @@ CONFIG_SCHEMA = cv.Schema( } ).extend(cv.COMPONENT_SCHEMA) - async def to_code(config): parent = await cg.get_variable(config[CONF_PANASONIC_HEATPUMP_ID]) for index, key in enumerate(TYPES):