forked from esphome/esphome
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
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,42 @@ | ||
name: Test build for emerald_ble | ||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: ${{matrix.python}} on ${{matrix.os}} | ||
runs-on: ${{matrix.os}} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest] | ||
python: | ||
- 3.12 | ||
|
||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{matrix.python}} | ||
cache: 'pip' # caching pip dependencies | ||
cache-dependency-path: '**/requirements-dev.txt' | ||
|
||
- name: Install esphome | ||
run: pip install -r test/requirements-dev.txt | ||
|
||
- uses: actions/cache@v3 | ||
id: esphome-cache # use this to check for `cache-hit` ==> if: steps.esphome-cache.outputs.cache-hit != 'true' | ||
with: | ||
path: | | ||
test/.esphome/** | ||
$HOME/.platformio/** | ||
key: ${{ matrix.os }}-${{matrix.python}}-esphome | ||
|
||
- name: Check config | ||
run: esphome config tests/*emerald*.yaml | ||
|
||
- name: Build | ||
run: esphome compile tests/*emerald*.yaml |
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,63 @@ | ||
substitutions: | ||
name: emerald-reader | ||
|
||
esphome: | ||
name: $name | ||
friendly_name: emerald_reader | ||
platformio_options: | ||
build_flags: | ||
- -Wall | ||
- -Wextra | ||
|
||
esp32: | ||
board: esp32dev | ||
framework: | ||
type: arduino | ||
|
||
# Enable logging | ||
logger: | ||
level: DEBUG | ||
|
||
# Enable Home Assistant API | ||
api: | ||
{} | ||
|
||
ota: | ||
platform: esphome | ||
|
||
wifi: | ||
ap: | ||
{} | ||
|
||
captive_portal: | ||
|
||
external_components: | ||
- source: ../esphome/components | ||
# requires ble_client and ble_tracker because I had to add some small features to authenticate properly | ||
components: [ ble_client, esp32_ble_tracker, emerald_ble ] | ||
|
||
# optional requirement used with daily energy sensor | ||
time: | ||
- platform: homeassistant | ||
id: homeassistant_time | ||
|
||
esp32_ble_tracker: | ||
|
||
ble_client: | ||
- mac_address: 01:02:03:04:05:06 | ||
id: emerald_advisor | ||
|
||
sensor: | ||
- platform: emerald_ble | ||
ble_client_id: emerald_advisor | ||
power: | ||
name: "Emerald Power" | ||
daily_energy: | ||
name: "Emerald Daily Energy" | ||
energy: | ||
name: "Emerald Total Energy" | ||
battery_level: | ||
name: "Emerald Battery" | ||
pairing_code: 012345 | ||
pulses_per_kwh: 3200 | ||
time_id: homeassistant_time # daily energy still works without a time_id, but recommended to include one to properly handle daylight savings, etc. |