From 94b63d7bc2675b02b3f869018de7a842a69edb00 Mon Sep 17 00:00:00 2001 From: acshef Date: Fri, 17 May 2024 22:17:09 -0600 Subject: [PATCH 1/4] Add device_class to valve core config (#6765) --- esphome/components/valve/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/esphome/components/valve/__init__.py b/esphome/components/valve/__init__.py index 22d617cc36..13c2947438 100644 --- a/esphome/components/valve/__init__.py +++ b/esphome/components/valve/__init__.py @@ -14,6 +14,8 @@ from esphome.const import ( CONF_STATE, CONF_STOP, CONF_TRIGGER_ID, + DEVICE_CLASS_GAS, + DEVICE_CLASS_WATER, ) from esphome.core import CORE, coroutine_with_priority from esphome.cpp_helpers import setup_entity @@ -22,6 +24,11 @@ IS_PLATFORM_COMPONENT = True CODEOWNERS = ["@esphome/core"] +DEVICE_CLASSES = [ + DEVICE_CLASS_GAS, + DEVICE_CLASS_WATER, +] + valve_ns = cg.esphome_ns.namespace("valve") Valve = valve_ns.class_("Valve", cg.EntityBase) @@ -65,6 +72,7 @@ VALVE_SCHEMA = cv.ENTITY_BASE_SCHEMA.extend(cv.MQTT_COMMAND_COMPONENT_SCHEMA).ex { cv.GenerateID(): cv.declare_id(Valve), cv.OnlyWith(CONF_MQTT_ID, "mqtt"): cv.declare_id(mqtt.MQTTValveComponent), + cv.Optional(CONF_DEVICE_CLASS): cv.one_of(*DEVICE_CLASSES, lower=True), cv.Optional(CONF_POSITION_COMMAND_TOPIC): cv.All( cv.requires_component("mqtt"), cv.subscribe_topic ), From 1164cb86106bc44cf57ab280e379499fe03f440b Mon Sep 17 00:00:00 2001 From: esphomebot Date: Sat, 18 May 2024 19:15:52 +1200 Subject: [PATCH 2/4] Synchronise Device Classes from Home Assistant (#6768) --- esphome/components/valve/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphome/components/valve/__init__.py b/esphome/components/valve/__init__.py index 13c2947438..ea6bfc6055 100644 --- a/esphome/components/valve/__init__.py +++ b/esphome/components/valve/__init__.py @@ -14,6 +14,7 @@ from esphome.const import ( CONF_STATE, CONF_STOP, CONF_TRIGGER_ID, + DEVICE_CLASS_EMPTY, DEVICE_CLASS_GAS, DEVICE_CLASS_WATER, ) @@ -25,6 +26,7 @@ IS_PLATFORM_COMPONENT = True CODEOWNERS = ["@esphome/core"] DEVICE_CLASSES = [ + DEVICE_CLASS_EMPTY, DEVICE_CLASS_GAS, DEVICE_CLASS_WATER, ] From 70e0925f9abaab0aa0cc13646b1115cdce230a98 Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Sun, 19 May 2024 01:31:36 +0200 Subject: [PATCH 3/4] Fix pip3 install (#6771) --- script/setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/setup b/script/setup index 71573a9352..1a18a6a9ea 100755 --- a/script/setup +++ b/script/setup @@ -20,7 +20,7 @@ fi pip3 install -r requirements.txt -r requirements_optional.txt -r requirements_test.txt -r requirements_dev.txt pip3 install setuptools wheel -pip3 install -e --config-settings editable_mode=compat ".[dev,test,displays]" +pip3 install -e ".[dev,test,displays]" --config-settings editable_mode=compat pre-commit install From 4469ba402498e6b8e20b6fc89873f70f61a1a21e Mon Sep 17 00:00:00 2001 From: tomaszduda23 Date: Sun, 19 May 2024 01:47:23 +0200 Subject: [PATCH 4/4] [tests] make test_build_components work with venv without installing esphome (#6761) --- script/test_build_components | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/script/test_build_components b/script/test_build_components index 4d91256572..f82dd5c3b6 100755 --- a/script/test_build_components +++ b/script/test_build_components @@ -37,9 +37,10 @@ start_esphome() { # Start esphome process echo "> [$target_component] [$test_name] [$target_platform]" - echo "esphome -s component_name $target_component -s component_dir ../../components/$target_component -s test_name $test_name -s target_platform $target_platform $esphome_command $component_test_file" + set -x # TODO: Validate escape of Command line substitution value - esphome -s component_name $target_component -s component_dir ../../components/$target_component -s test_name $test_name -s target_platform $target_platform $esphome_command $component_test_file + python -m esphome -s component_name $target_component -s component_dir ../../components/$target_component -s test_name $test_name -s target_platform $target_platform $esphome_command $component_test_file + { set +x; } 2>/dev/null } # Find all test yaml files.