mirror of
https://github.com/esphome/esphome.git
synced 2025-08-06 02:17:45 +00:00
Merge branch 'integration' into memory_api
This commit is contained in:
commit
cf472d5281
105
.github/workflows/ci.yml
vendored
105
.github/workflows/ci.yml
vendored
@ -39,7 +39,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Generate cache-key
|
- name: Generate cache-key
|
||||||
id: cache-key
|
id: cache-key
|
||||||
run: echo key="${{ hashFiles('requirements.txt', 'requirements_test.txt') }}" >> $GITHUB_OUTPUT
|
run: echo key="${{ hashFiles('requirements.txt', 'requirements_test.txt', '.pre-commit-config.yaml') }}" >> $GITHUB_OUTPUT
|
||||||
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
||||||
id: python
|
id: python
|
||||||
uses: actions/setup-python@v5.6.0
|
uses: actions/setup-python@v5.6.0
|
||||||
@ -58,55 +58,9 @@ jobs:
|
|||||||
python -m venv venv
|
python -m venv venv
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
python --version
|
python --version
|
||||||
pip install -r requirements.txt -r requirements_test.txt
|
pip install -r requirements.txt -r requirements_test.txt pre-commit
|
||||||
pip install -e .
|
pip install -e .
|
||||||
|
|
||||||
ruff:
|
|
||||||
name: Check ruff
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
needs:
|
|
||||||
- common
|
|
||||||
- determine-jobs
|
|
||||||
if: needs.determine-jobs.outputs.python-linters == 'true'
|
|
||||||
steps:
|
|
||||||
- name: Check out code from GitHub
|
|
||||||
uses: actions/checkout@v4.2.2
|
|
||||||
- name: Restore Python
|
|
||||||
uses: ./.github/actions/restore-python
|
|
||||||
with:
|
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
|
||||||
cache-key: ${{ needs.common.outputs.cache-key }}
|
|
||||||
- name: Run Ruff
|
|
||||||
run: |
|
|
||||||
. venv/bin/activate
|
|
||||||
ruff format esphome tests
|
|
||||||
- name: Suggested changes
|
|
||||||
run: script/ci-suggest-changes
|
|
||||||
if: always()
|
|
||||||
|
|
||||||
flake8:
|
|
||||||
name: Check flake8
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
needs:
|
|
||||||
- common
|
|
||||||
- determine-jobs
|
|
||||||
if: needs.determine-jobs.outputs.python-linters == 'true'
|
|
||||||
steps:
|
|
||||||
- name: Check out code from GitHub
|
|
||||||
uses: actions/checkout@v4.2.2
|
|
||||||
- name: Restore Python
|
|
||||||
uses: ./.github/actions/restore-python
|
|
||||||
with:
|
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
|
||||||
cache-key: ${{ needs.common.outputs.cache-key }}
|
|
||||||
- name: Run flake8
|
|
||||||
run: |
|
|
||||||
. venv/bin/activate
|
|
||||||
flake8 esphome
|
|
||||||
- name: Suggested changes
|
|
||||||
run: script/ci-suggest-changes
|
|
||||||
if: always()
|
|
||||||
|
|
||||||
pylint:
|
pylint:
|
||||||
name: Check pylint
|
name: Check pylint
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
@ -248,7 +202,6 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
integration-tests: ${{ steps.determine.outputs.integration-tests }}
|
integration-tests: ${{ steps.determine.outputs.integration-tests }}
|
||||||
clang-tidy: ${{ steps.determine.outputs.clang-tidy }}
|
clang-tidy: ${{ steps.determine.outputs.clang-tidy }}
|
||||||
clang-format: ${{ steps.determine.outputs.clang-format }}
|
|
||||||
python-linters: ${{ steps.determine.outputs.python-linters }}
|
python-linters: ${{ steps.determine.outputs.python-linters }}
|
||||||
changed-components: ${{ steps.determine.outputs.changed-components }}
|
changed-components: ${{ steps.determine.outputs.changed-components }}
|
||||||
component-test-count: ${{ steps.determine.outputs.component-test-count }}
|
component-test-count: ${{ steps.determine.outputs.component-test-count }}
|
||||||
@ -276,7 +229,6 @@ jobs:
|
|||||||
# Extract individual fields
|
# Extract individual fields
|
||||||
echo "integration-tests=$(echo "$output" | jq -r '.integration_tests')" >> $GITHUB_OUTPUT
|
echo "integration-tests=$(echo "$output" | jq -r '.integration_tests')" >> $GITHUB_OUTPUT
|
||||||
echo "clang-tidy=$(echo "$output" | jq -r '.clang_tidy')" >> $GITHUB_OUTPUT
|
echo "clang-tidy=$(echo "$output" | jq -r '.clang_tidy')" >> $GITHUB_OUTPUT
|
||||||
echo "clang-format=$(echo "$output" | jq -r '.clang_format')" >> $GITHUB_OUTPUT
|
|
||||||
echo "python-linters=$(echo "$output" | jq -r '.python_linters')" >> $GITHUB_OUTPUT
|
echo "python-linters=$(echo "$output" | jq -r '.python_linters')" >> $GITHUB_OUTPUT
|
||||||
echo "changed-components=$(echo "$output" | jq -c '.changed_components')" >> $GITHUB_OUTPUT
|
echo "changed-components=$(echo "$output" | jq -c '.changed_components')" >> $GITHUB_OUTPUT
|
||||||
echo "component-test-count=$(echo "$output" | jq -r '.component_test_count')" >> $GITHUB_OUTPUT
|
echo "component-test-count=$(echo "$output" | jq -r '.component_test_count')" >> $GITHUB_OUTPUT
|
||||||
@ -317,41 +269,12 @@ jobs:
|
|||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
pytest -vv --no-cov --tb=native -n auto tests/integration/
|
pytest -vv --no-cov --tb=native -n auto tests/integration/
|
||||||
|
|
||||||
clang-format:
|
|
||||||
name: Check clang-format
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
needs:
|
|
||||||
- common
|
|
||||||
- determine-jobs
|
|
||||||
if: needs.determine-jobs.outputs.clang-format == 'true'
|
|
||||||
steps:
|
|
||||||
- name: Check out code from GitHub
|
|
||||||
uses: actions/checkout@v4.2.2
|
|
||||||
- name: Restore Python
|
|
||||||
uses: ./.github/actions/restore-python
|
|
||||||
with:
|
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
|
||||||
cache-key: ${{ needs.common.outputs.cache-key }}
|
|
||||||
- name: Install clang-format
|
|
||||||
run: |
|
|
||||||
. venv/bin/activate
|
|
||||||
pip install clang-format -c requirements_dev.txt
|
|
||||||
- name: Run clang-format
|
|
||||||
run: |
|
|
||||||
. venv/bin/activate
|
|
||||||
script/clang-format -i
|
|
||||||
git diff-index --quiet HEAD --
|
|
||||||
- name: Suggested changes
|
|
||||||
run: script/ci-suggest-changes
|
|
||||||
if: always()
|
|
||||||
|
|
||||||
clang-tidy-deps:
|
clang-tidy-deps:
|
||||||
name: Clang-tidy dependencies
|
name: Clang-tidy dependencies
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
needs:
|
needs:
|
||||||
- common
|
- common
|
||||||
- ci-custom
|
- ci-custom
|
||||||
- clang-format
|
|
||||||
- pytest
|
- pytest
|
||||||
- determine-jobs
|
- determine-jobs
|
||||||
if: |
|
if: |
|
||||||
@ -573,15 +496,32 @@ jobs:
|
|||||||
./script/test_build_components -e compile -c $component
|
./script/test_build_components -e compile -c $component
|
||||||
done
|
done
|
||||||
|
|
||||||
|
pre-commit-ci-lite:
|
||||||
|
name: pre-commit.ci lite
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- common
|
||||||
|
if: github.event_name == 'pull_request' && github.base_ref != 'beta' && github.base_ref != 'release'
|
||||||
|
steps:
|
||||||
|
- name: Check out code from GitHub
|
||||||
|
uses: actions/checkout@v4.2.2
|
||||||
|
- name: Restore Python
|
||||||
|
uses: ./.github/actions/restore-python
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
|
cache-key: ${{ needs.common.outputs.cache-key }}
|
||||||
|
- uses: pre-commit/action@v3.0.1
|
||||||
|
env:
|
||||||
|
SKIP: pylint,clang-tidy-hash,yamllint
|
||||||
|
- uses: pre-commit-ci/lite-action@v1.1.0
|
||||||
|
if: always()
|
||||||
|
|
||||||
ci-status:
|
ci-status:
|
||||||
name: CI Status
|
name: CI Status
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
needs:
|
needs:
|
||||||
- common
|
- common
|
||||||
- ruff
|
|
||||||
- ci-custom
|
- ci-custom
|
||||||
- clang-format
|
|
||||||
- flake8
|
|
||||||
- pylint
|
- pylint
|
||||||
- pytest
|
- pytest
|
||||||
- integration-tests
|
- integration-tests
|
||||||
@ -592,6 +532,7 @@ jobs:
|
|||||||
- test-build-components
|
- test-build-components
|
||||||
- test-build-components-splitter
|
- test-build-components-splitter
|
||||||
- test-build-components-split
|
- test-build-components-split
|
||||||
|
- pre-commit-ci-lite
|
||||||
if: always()
|
if: always()
|
||||||
steps:
|
steps:
|
||||||
- name: Success
|
- name: Success
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
ci:
|
ci:
|
||||||
autoupdate_commit_msg: 'pre-commit: autoupdate'
|
autoupdate_commit_msg: 'pre-commit: autoupdate'
|
||||||
autoupdate_schedule: weekly
|
autoupdate_schedule: off # Disabled until ruff versions are synced between deps and pre-commit
|
||||||
# Skip hooks that have issues in pre-commit CI environment
|
# Skip hooks that have issues in pre-commit CI environment
|
||||||
skip: [pylint, clang-tidy-hash, yamllint]
|
skip: [pylint, clang-tidy-hash, yamllint]
|
||||||
|
|
||||||
|
@ -20,14 +20,16 @@ adjusted_ids = set()
|
|||||||
|
|
||||||
CONFIG_SCHEMA = cv.All(
|
CONFIG_SCHEMA = cv.All(
|
||||||
cv.ensure_list(
|
cv.ensure_list(
|
||||||
{
|
cv.COMPONENT_SCHEMA.extend(
|
||||||
cv.GenerateID(): cv.declare_id(EspLdo),
|
{
|
||||||
cv.Required(CONF_VOLTAGE): cv.All(
|
cv.GenerateID(): cv.declare_id(EspLdo),
|
||||||
cv.voltage, cv.float_range(min=0.5, max=2.7)
|
cv.Required(CONF_VOLTAGE): cv.All(
|
||||||
),
|
cv.voltage, cv.float_range(min=0.5, max=2.7)
|
||||||
cv.Required(CONF_CHANNEL): cv.one_of(*CHANNELS, int=True),
|
),
|
||||||
cv.Optional(CONF_ADJUSTABLE, default=False): cv.boolean,
|
cv.Required(CONF_CHANNEL): cv.one_of(*CHANNELS, int=True),
|
||||||
}
|
cv.Optional(CONF_ADJUSTABLE, default=False): cv.boolean,
|
||||||
|
}
|
||||||
|
)
|
||||||
),
|
),
|
||||||
cv.only_with_esp_idf,
|
cv.only_with_esp_idf,
|
||||||
only_on_variant(supported=[VARIANT_ESP32P4]),
|
only_on_variant(supported=[VARIANT_ESP32P4]),
|
||||||
|
@ -17,6 +17,9 @@ class EspLdo : public Component {
|
|||||||
void set_adjustable(bool adjustable) { this->adjustable_ = adjustable; }
|
void set_adjustable(bool adjustable) { this->adjustable_ = adjustable; }
|
||||||
void set_voltage(float voltage) { this->voltage_ = voltage; }
|
void set_voltage(float voltage) { this->voltage_ = voltage; }
|
||||||
void adjust_voltage(float voltage);
|
void adjust_voltage(float voltage);
|
||||||
|
float get_setup_priority() const override {
|
||||||
|
return setup_priority::BUS; // LDO setup should be done early
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int channel_;
|
int channel_;
|
||||||
|
@ -6,6 +6,7 @@ esp_ldo:
|
|||||||
- id: ldo_4
|
- id: ldo_4
|
||||||
channel: 4
|
channel: 4
|
||||||
voltage: 2.0V
|
voltage: 2.0V
|
||||||
|
setup_priority: 900
|
||||||
|
|
||||||
esphome:
|
esphome:
|
||||||
on_boot:
|
on_boot:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user