diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a1887c33c..b49237db26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -454,7 +454,7 @@ jobs: matrix: file: ${{ fromJson(needs.list-components.outputs.components) }} steps: - - name: Install libsodium + - name: Install dependencies run: sudo apt-get install libsodium-dev libsdl2-dev - name: Check out code from GitHub @@ -508,8 +508,8 @@ jobs: - name: List components run: echo ${{ matrix.components }} - - name: Install libsodium - run: sudo apt-get install libsodium-dev + - name: Install dependencies + run: sudo apt-get install libsodium-dev libsdl2-dev - name: Check out code from GitHub uses: actions/checkout@v4.1.6 diff --git a/esphome/__main__.py b/esphome/__main__.py index f3c4ff3e23..5ff1a28ec7 100644 --- a/esphome/__main__.py +++ b/esphome/__main__.py @@ -488,6 +488,15 @@ def command_run(args, config): if exit_code != 0: return exit_code _LOGGER.info("Successfully compiled program.") + if CORE.is_host: + from esphome.platformio_api import get_idedata + + idedata = get_idedata(config) + if idedata is None: + return 1 + program_path = idedata.raw["prog_path"] + return run_external_process(program_path) + port = choose_upload_log_host( default=args.device, check_default=None, diff --git a/esphome/components/x9c/output.py b/esphome/components/x9c/output.py index 44e9d729b3..56820efdfa 100644 --- a/esphome/components/x9c/output.py +++ b/esphome/components/x9c/output.py @@ -8,6 +8,7 @@ from esphome.const import ( CONF_INC_PIN, CONF_UD_PIN, CONF_INITIAL_VALUE, + CONF_STEP_DELAY, ) CODEOWNERS = ["@EtienneMD"] @@ -26,6 +27,7 @@ CONFIG_SCHEMA = cv.All( cv.Optional(CONF_INITIAL_VALUE, default=1.0): cv.float_range( min=0.01, max=1.0 ), + cv.Optional(CONF_STEP_DELAY, default=1): cv.int_range(min=1, max=100), } ) ) @@ -44,3 +46,4 @@ async def to_code(config): cg.add(var.set_ud_pin(ud_pin)) cg.add(var.set_initial_value(config[CONF_INITIAL_VALUE])) + cg.add(var.set_step_delay(config[CONF_STEP_DELAY])) diff --git a/esphome/components/x9c/x9c.cpp b/esphome/components/x9c/x9c.cpp index 32a1375f02..4e7a94266e 100644 --- a/esphome/components/x9c/x9c.cpp +++ b/esphome/components/x9c/x9c.cpp @@ -22,9 +22,9 @@ void X9cOutput::trim_value(int change_amount) { for (int i = 0; i < abs(change_amount); i++) { // Move wiper this->inc_pin_->digital_write(true); - delayMicroseconds(1); + delayMicroseconds(this->step_delay_); this->inc_pin_->digital_write(false); - delayMicroseconds(1); + delayMicroseconds(this->step_delay_); } delayMicroseconds(100); // Let value settle @@ -69,6 +69,7 @@ void X9cOutput::dump_config() { LOG_PIN(" Increment Pin: ", this->inc_pin_); LOG_PIN(" Up/Down Pin: ", this->ud_pin_); ESP_LOGCONFIG(TAG, " Initial Value: %f", this->initial_value_); + ESP_LOGCONFIG(TAG, " Step Delay: %d", this->step_delay_); LOG_FLOAT_OUTPUT(this); } diff --git a/esphome/components/x9c/x9c.h b/esphome/components/x9c/x9c.h index 924460c841..e7cc29a6cc 100644 --- a/esphome/components/x9c/x9c.h +++ b/esphome/components/x9c/x9c.h @@ -13,6 +13,7 @@ class X9cOutput : public output::FloatOutput, public Component { void set_inc_pin(InternalGPIOPin *pin) { inc_pin_ = pin; } void set_ud_pin(InternalGPIOPin *pin) { ud_pin_ = pin; } void set_initial_value(float initial_value) { initial_value_ = initial_value; } + void set_step_delay(int step_delay) { step_delay_ = step_delay; } void setup() override; void dump_config() override; @@ -26,6 +27,7 @@ class X9cOutput : public output::FloatOutput, public Component { InternalGPIOPin *ud_pin_; float initial_value_; float pot_value_; + int step_delay_; }; } // namespace x9c diff --git a/esphome/const.py b/esphome/const.py index 6255230a49..47b933f3f3 100644 --- a/esphome/const.py +++ b/esphome/const.py @@ -784,6 +784,7 @@ CONF_STATIC_IP = "static_ip" CONF_STATUS = "status" CONF_STB_PIN = "stb_pin" CONF_STEP = "step" +CONF_STEP_DELAY = "step_delay" CONF_STEP_MODE = "step_mode" CONF_STEP_PIN = "step_pin" CONF_STOP = "stop" diff --git a/script/sync-device_class.py b/script/sync-device_class.py index 12e1bb6a9f..121c89b8f9 100755 --- a/script/sync-device_class.py +++ b/script/sync-device_class.py @@ -10,6 +10,7 @@ from homeassistant.components.event import EventDeviceClass from homeassistant.components.number import NumberDeviceClass from homeassistant.components.sensor import SensorDeviceClass from homeassistant.components.switch import SwitchDeviceClass +from homeassistant.components.update import UpdateDeviceClass from homeassistant.components.valve import ValveDeviceClass # pylint: enable=import-error @@ -27,6 +28,7 @@ DOMAINS = { "number": NumberDeviceClass, "sensor": SensorDeviceClass, "switch": SwitchDeviceClass, + "update": UpdateDeviceClass, "valve": ValveDeviceClass, } diff --git a/tests/components/x9c/test.esp32-c3-idf.yaml b/tests/components/x9c/test.esp32-c3-idf.yaml index a0480aa68f..1234581329 100644 --- a/tests/components/x9c/test.esp32-c3-idf.yaml +++ b/tests/components/x9c/test.esp32-c3-idf.yaml @@ -5,3 +5,4 @@ output: inc_pin: 4 ud_pin: 5 initial_value: 0.5 + step_delay: 50 diff --git a/tests/components/x9c/test.esp32-c3.yaml b/tests/components/x9c/test.esp32-c3.yaml index a0480aa68f..1234581329 100644 --- a/tests/components/x9c/test.esp32-c3.yaml +++ b/tests/components/x9c/test.esp32-c3.yaml @@ -5,3 +5,4 @@ output: inc_pin: 4 ud_pin: 5 initial_value: 0.5 + step_delay: 50 diff --git a/tests/components/x9c/test.esp32-idf.yaml b/tests/components/x9c/test.esp32-idf.yaml index 28b18f7a92..5f1468e94b 100644 --- a/tests/components/x9c/test.esp32-idf.yaml +++ b/tests/components/x9c/test.esp32-idf.yaml @@ -5,3 +5,4 @@ output: inc_pin: 14 ud_pin: 15 initial_value: 0.5 + step_delay: 50 diff --git a/tests/components/x9c/test.esp32.yaml b/tests/components/x9c/test.esp32.yaml index 28b18f7a92..5f1468e94b 100644 --- a/tests/components/x9c/test.esp32.yaml +++ b/tests/components/x9c/test.esp32.yaml @@ -5,3 +5,4 @@ output: inc_pin: 14 ud_pin: 15 initial_value: 0.5 + step_delay: 50 diff --git a/tests/components/x9c/test.esp8266.yaml b/tests/components/x9c/test.esp8266.yaml index 28b18f7a92..5f1468e94b 100644 --- a/tests/components/x9c/test.esp8266.yaml +++ b/tests/components/x9c/test.esp8266.yaml @@ -5,3 +5,4 @@ output: inc_pin: 14 ud_pin: 15 initial_value: 0.5 + step_delay: 50 diff --git a/tests/components/x9c/test.rp2040.yaml b/tests/components/x9c/test.rp2040.yaml index a0480aa68f..1234581329 100644 --- a/tests/components/x9c/test.rp2040.yaml +++ b/tests/components/x9c/test.rp2040.yaml @@ -5,3 +5,4 @@ output: inc_pin: 4 ud_pin: 5 initial_value: 0.5 + step_delay: 50