-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update build actions, esphome, logger
- Merge Github actions into one file - Add current Home Assistant version check - Add custom component downloads for YAML based integrations - Add ESPHome config - Clean up logger, add filters - Fix linting
- Loading branch information
Showing
11 changed files
with
731 additions
and
75 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
--- | ||
# Source: https://github.com/frenck/action-home-assistant | ||
# Example: https://github.com/frenck/home-assistant-config/blob/master/.github/workflows/home-assistant.yml | ||
# | ||
name: Home Assistant CI | ||
# yamllint disable-line rule:truthy | ||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: 0 12 * * 4 | ||
jobs: | ||
yamllint: | ||
name: 🧹 YAML Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 📥 Check out repository | ||
uses: actions/[email protected] | ||
- name: 🚀 Run YAMLlint | ||
uses: frenck/[email protected] | ||
|
||
remarklint: | ||
name: 🧹 Remark Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 📥 Check out repository | ||
uses: actions/[email protected] | ||
- name: 🚀 Run Remark lint | ||
uses: "docker://pipelinecomponents/remark-lint:latest" | ||
continue-on-error: true | ||
with: | ||
args: "remark --no-stdout --color --frail --use preset-lint-recommended ." | ||
|
||
ha_version: | ||
name: "🏠 Get Home Assistant Version" | ||
runs-on: ubuntu-latest | ||
outputs: | ||
current_version: ${{ steps.currentver.outputs.current_version }} | ||
steps: | ||
- name: 📥 Check out repository | ||
uses: actions/[email protected] | ||
- name: 🚀 Get Installed Version from .HA_VERSION | ||
id: currentver | ||
run: | | ||
HA_VERSION=$(<.HA_VERSION) | ||
echo $HA_VERSION | ||
echo "current_version=$HA_VERSION" >> $GITHUB_OUTPUT | ||
home-assistant: | ||
name: "🏠 Home Assistant Core ${{ matrix.version }} Configuration Check" | ||
needs: [yamllint, ha_version] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
version: ["${{ needs.ha_version.outputs.current_version }}", "stable", "beta", "dev"] | ||
steps: | ||
- name: 📥 Check out repository | ||
uses: actions/[email protected] | ||
|
||
- name: 📄 Create empty files | ||
run: | | ||
touch ./home-assistant_v2.db | ||
touch ./home-assistant.log | ||
- name: 📁 Create custom_components folder | ||
run: | | ||
mkdir -p ./custom_components | ||
# Check out custom components that require YAML configuration. | ||
# yamllint disable rule:line-length | ||
|
||
- name: 📥 Clone custom component (Dreamscreen) | ||
run: | | ||
git clone https://github.com/J3n50m4t/Home-Assistant-DreamScreen-Service.git | ||
mv -v Home-Assistant-DreamScreen-Service/custom_components/* ./custom_components | ||
- name: 📥 Clone custom component (UniFi Status) | ||
run: | | ||
git clone https://github.com/zvldz/unifi_status.git | ||
mv -v unifi_status/custom_components/* ./custom_components | ||
# yamllint enable rule:line-length | ||
|
||
- name: 🚀 Run Home Assistant Configuration Check | ||
uses: frenck/[email protected] | ||
with: | ||
path: "." | ||
secrets: ./.stubs/secrets.yaml | ||
version: "${{ matrix.version }}" | ||
|
||
esphome: | ||
name: "🛠️ ESPHome Configuration Check" | ||
runs-on: ubuntu-latest | ||
needs: [yamllint] | ||
steps: | ||
- name: 📥 Check out repository | ||
uses: actions/[email protected] | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
pip install esphome | ||
pip list | ||
esphome version | ||
- name: Copy secrets stub into configuration folder | ||
run: cp ./.stubs/espsecrets.yaml ./esphome/secrets.yaml | ||
- name: 🚀 Run ESPHome on all files | ||
# yamllint disable rule:line-length | ||
run: | | ||
for file in $(find ./esphome -type f -name "*.yaml" -maxdepth 1 -not -name "secrets.yaml"); do esphome config "${file}"; done |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
# Example Secrets | ||
# | ||
wifi_ssid: "wifi_ssid" | ||
wifi_password: "wifi_password" | ||
ota_password: "ota_password" | ||
ap_password: "ap_password" | ||
# Not my real key, nice try! | ||
encryption_key: "QTuVWVmiUMboASbE3m5cpAN2wEKp80WfESFjmsNTlaM=" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Gitignore settings for ESPHome | ||
# This is an example and may include too much for your use-case. | ||
# You can modify this file to suit your needs. | ||
/.esphome/ | ||
/secrets.yaml | ||
/trash/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
--- | ||
# Car presence & position detection in Home Assistant with ESPHome | ||
# source: https://adonno.com/car-presence-position-detection/ | ||
|
||
esphome: | ||
name: car-presence | ||
friendly_name: Car Presence | ||
|
||
esp8266: | ||
board: d1_mini | ||
|
||
# Enable logging | ||
logger: | ||
|
||
# Enable Home Assistant API | ||
api: | ||
encryption: | ||
key: !secret encryption_key | ||
|
||
ota: | ||
password: !secret ota_password | ||
|
||
wifi: | ||
ssid: !secret wifi_ssid | ||
password: !secret wifi_password | ||
fast_connect: true | ||
|
||
# Enable fallback hotspot (captive portal) in case wifi connection fails | ||
ap: | ||
ssid: "AP" | ||
password: !secret ap_password | ||
ap_timeout: 3min | ||
|
||
captive_portal: | ||
|
||
time: | ||
- platform: homeassistant | ||
id: homeassistant_time | ||
timezone: America/Boise | ||
|
||
text_sensor: | ||
- platform: version | ||
name: "ESPHome Version" | ||
|
||
- platform: wifi_info | ||
ip_address: | ||
name: "IP" | ||
ssid: | ||
name: "SSID" | ||
bssid: | ||
name: "BSSID" | ||
|
||
button: | ||
- platform: restart | ||
name: "Restart" | ||
|
||
binary_sensor: | ||
- platform: template | ||
name: "Left" | ||
device_class: presence | ||
lambda: |- | ||
return id(car_presence_left_distance).state < 1.5; | ||
- platform: template | ||
name: "Right" | ||
device_class: presence | ||
lambda: |- | ||
return id(car_presence_right_distance).state < 1.5; | ||
sensor: | ||
- platform: uptime | ||
name: "Uptime" | ||
unit_of_measurement: h | ||
filters: | ||
- lambda: return int((x + 1800.0) / 3600.0); | ||
|
||
- platform: wifi_signal | ||
name: "Wifi Signal" | ||
update_interval: 5min | ||
|
||
- platform: ultrasonic | ||
name: "Left Distance" | ||
id: "car_presence_left_distance" | ||
trigger_pin: D1 | ||
echo_pin: D2 | ||
update_interval: 10s | ||
filters: | ||
- filter_out: nan | ||
|
||
- platform: ultrasonic | ||
name: "Right Distance" | ||
id: "car_presence_right_distance" | ||
trigger_pin: D3 | ||
echo_pin: D0 | ||
update_interval: 10s | ||
filters: | ||
- filter_out: nan |
Oops, something went wrong.