mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 01:07:45 +01:00
commit
4e8a7986cd
13 changed files with 29 additions and 7 deletions
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
|
@ -454,7 +454,7 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
file: ${{ fromJson(needs.list-components.outputs.components) }}
|
file: ${{ fromJson(needs.list-components.outputs.components) }}
|
||||||
steps:
|
steps:
|
||||||
- name: Install libsodium
|
- name: Install dependencies
|
||||||
run: sudo apt-get install libsodium-dev libsdl2-dev
|
run: sudo apt-get install libsodium-dev libsdl2-dev
|
||||||
|
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
|
@ -508,8 +508,8 @@ jobs:
|
||||||
- name: List components
|
- name: List components
|
||||||
run: echo ${{ matrix.components }}
|
run: echo ${{ matrix.components }}
|
||||||
|
|
||||||
- name: Install libsodium
|
- name: Install dependencies
|
||||||
run: sudo apt-get install libsodium-dev
|
run: sudo apt-get install libsodium-dev libsdl2-dev
|
||||||
|
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v4.1.6
|
uses: actions/checkout@v4.1.6
|
||||||
|
|
|
@ -488,6 +488,15 @@ def command_run(args, config):
|
||||||
if exit_code != 0:
|
if exit_code != 0:
|
||||||
return exit_code
|
return exit_code
|
||||||
_LOGGER.info("Successfully compiled program.")
|
_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(
|
port = choose_upload_log_host(
|
||||||
default=args.device,
|
default=args.device,
|
||||||
check_default=None,
|
check_default=None,
|
||||||
|
|
|
@ -8,6 +8,7 @@ from esphome.const import (
|
||||||
CONF_INC_PIN,
|
CONF_INC_PIN,
|
||||||
CONF_UD_PIN,
|
CONF_UD_PIN,
|
||||||
CONF_INITIAL_VALUE,
|
CONF_INITIAL_VALUE,
|
||||||
|
CONF_STEP_DELAY,
|
||||||
)
|
)
|
||||||
|
|
||||||
CODEOWNERS = ["@EtienneMD"]
|
CODEOWNERS = ["@EtienneMD"]
|
||||||
|
@ -26,6 +27,7 @@ CONFIG_SCHEMA = cv.All(
|
||||||
cv.Optional(CONF_INITIAL_VALUE, default=1.0): cv.float_range(
|
cv.Optional(CONF_INITIAL_VALUE, default=1.0): cv.float_range(
|
||||||
min=0.01, max=1.0
|
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_ud_pin(ud_pin))
|
||||||
|
|
||||||
cg.add(var.set_initial_value(config[CONF_INITIAL_VALUE]))
|
cg.add(var.set_initial_value(config[CONF_INITIAL_VALUE]))
|
||||||
|
cg.add(var.set_step_delay(config[CONF_STEP_DELAY]))
|
||||||
|
|
|
@ -22,9 +22,9 @@ void X9cOutput::trim_value(int change_amount) {
|
||||||
|
|
||||||
for (int i = 0; i < abs(change_amount); i++) { // Move wiper
|
for (int i = 0; i < abs(change_amount); i++) { // Move wiper
|
||||||
this->inc_pin_->digital_write(true);
|
this->inc_pin_->digital_write(true);
|
||||||
delayMicroseconds(1);
|
delayMicroseconds(this->step_delay_);
|
||||||
this->inc_pin_->digital_write(false);
|
this->inc_pin_->digital_write(false);
|
||||||
delayMicroseconds(1);
|
delayMicroseconds(this->step_delay_);
|
||||||
}
|
}
|
||||||
|
|
||||||
delayMicroseconds(100); // Let value settle
|
delayMicroseconds(100); // Let value settle
|
||||||
|
@ -69,6 +69,7 @@ void X9cOutput::dump_config() {
|
||||||
LOG_PIN(" Increment Pin: ", this->inc_pin_);
|
LOG_PIN(" Increment Pin: ", this->inc_pin_);
|
||||||
LOG_PIN(" Up/Down Pin: ", this->ud_pin_);
|
LOG_PIN(" Up/Down Pin: ", this->ud_pin_);
|
||||||
ESP_LOGCONFIG(TAG, " Initial Value: %f", this->initial_value_);
|
ESP_LOGCONFIG(TAG, " Initial Value: %f", this->initial_value_);
|
||||||
|
ESP_LOGCONFIG(TAG, " Step Delay: %d", this->step_delay_);
|
||||||
LOG_FLOAT_OUTPUT(this);
|
LOG_FLOAT_OUTPUT(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ class X9cOutput : public output::FloatOutput, public Component {
|
||||||
void set_inc_pin(InternalGPIOPin *pin) { inc_pin_ = pin; }
|
void set_inc_pin(InternalGPIOPin *pin) { inc_pin_ = pin; }
|
||||||
void set_ud_pin(InternalGPIOPin *pin) { ud_pin_ = pin; }
|
void set_ud_pin(InternalGPIOPin *pin) { ud_pin_ = pin; }
|
||||||
void set_initial_value(float initial_value) { initial_value_ = initial_value; }
|
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 setup() override;
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
|
@ -26,6 +27,7 @@ class X9cOutput : public output::FloatOutput, public Component {
|
||||||
InternalGPIOPin *ud_pin_;
|
InternalGPIOPin *ud_pin_;
|
||||||
float initial_value_;
|
float initial_value_;
|
||||||
float pot_value_;
|
float pot_value_;
|
||||||
|
int step_delay_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace x9c
|
} // namespace x9c
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""Constants used by esphome."""
|
"""Constants used by esphome."""
|
||||||
|
|
||||||
__version__ = "2024.6.0b1"
|
__version__ = "2024.6.0b2"
|
||||||
|
|
||||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||||
VALID_SUBSTITUTIONS_CHARACTERS = (
|
VALID_SUBSTITUTIONS_CHARACTERS = (
|
||||||
|
@ -784,6 +784,7 @@ CONF_STATIC_IP = "static_ip"
|
||||||
CONF_STATUS = "status"
|
CONF_STATUS = "status"
|
||||||
CONF_STB_PIN = "stb_pin"
|
CONF_STB_PIN = "stb_pin"
|
||||||
CONF_STEP = "step"
|
CONF_STEP = "step"
|
||||||
|
CONF_STEP_DELAY = "step_delay"
|
||||||
CONF_STEP_MODE = "step_mode"
|
CONF_STEP_MODE = "step_mode"
|
||||||
CONF_STEP_PIN = "step_pin"
|
CONF_STEP_PIN = "step_pin"
|
||||||
CONF_STOP = "stop"
|
CONF_STOP = "stop"
|
||||||
|
|
|
@ -12,7 +12,7 @@ pyserial==3.5
|
||||||
platformio==6.1.15 # When updating platformio, also update Dockerfile
|
platformio==6.1.15 # When updating platformio, also update Dockerfile
|
||||||
esptool==4.7.0
|
esptool==4.7.0
|
||||||
click==8.1.7
|
click==8.1.7
|
||||||
esphome-dashboard==20240429.1
|
esphome-dashboard==20240613.0
|
||||||
aioesphomeapi==24.3.0
|
aioesphomeapi==24.3.0
|
||||||
zeroconf==0.132.2
|
zeroconf==0.132.2
|
||||||
python-magic==0.4.27
|
python-magic==0.4.27
|
||||||
|
|
|
@ -5,3 +5,4 @@ output:
|
||||||
inc_pin: 4
|
inc_pin: 4
|
||||||
ud_pin: 5
|
ud_pin: 5
|
||||||
initial_value: 0.5
|
initial_value: 0.5
|
||||||
|
step_delay: 50
|
||||||
|
|
|
@ -5,3 +5,4 @@ output:
|
||||||
inc_pin: 4
|
inc_pin: 4
|
||||||
ud_pin: 5
|
ud_pin: 5
|
||||||
initial_value: 0.5
|
initial_value: 0.5
|
||||||
|
step_delay: 50
|
||||||
|
|
|
@ -5,3 +5,4 @@ output:
|
||||||
inc_pin: 14
|
inc_pin: 14
|
||||||
ud_pin: 15
|
ud_pin: 15
|
||||||
initial_value: 0.5
|
initial_value: 0.5
|
||||||
|
step_delay: 50
|
||||||
|
|
|
@ -5,3 +5,4 @@ output:
|
||||||
inc_pin: 14
|
inc_pin: 14
|
||||||
ud_pin: 15
|
ud_pin: 15
|
||||||
initial_value: 0.5
|
initial_value: 0.5
|
||||||
|
step_delay: 50
|
||||||
|
|
|
@ -5,3 +5,4 @@ output:
|
||||||
inc_pin: 14
|
inc_pin: 14
|
||||||
ud_pin: 15
|
ud_pin: 15
|
||||||
initial_value: 0.5
|
initial_value: 0.5
|
||||||
|
step_delay: 50
|
||||||
|
|
|
@ -5,3 +5,4 @@ output:
|
||||||
inc_pin: 4
|
inc_pin: 4
|
||||||
ud_pin: 5
|
ud_pin: 5
|
||||||
initial_value: 0.5
|
initial_value: 0.5
|
||||||
|
step_delay: 50
|
||||||
|
|
Loading…
Reference in a new issue