Skip to content

Commit

Permalink
Add support for multiple project manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenpapierski committed Aug 9, 2024
1 parent f237a03 commit a9ef327
Show file tree
Hide file tree
Showing 8 changed files with 138 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Build and Publish ESPHome firmware and website
name: Bed Presence Mk1 Firmware Changed

on:
push:
branches:
- main
paths:
- '**.yaml'
- 'bed-presence-mk1.yaml'
- 'bed-presence-mk1/*.yaml'

jobs:
build:
Expand All @@ -14,3 +15,4 @@ jobs:
files: bed-presence-mk1.yaml
name: Bed Presence Mk1
esphome_version: latest
manifest_filename: bpmk1-manifest.json
2 changes: 1 addition & 1 deletion .github/workflows/workflow-pages-change.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish ESPHome website
name: Website Changed

on:
push:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/workflow-test-fw-change.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Bed Presence Mk1 Firmware Changed

on:
push:
branches:
- main
paths:
- 'test.yaml'

jobs:
build:
uses: ./.github/workflows/action-build-and-publish.yml
with:
files: test.yaml
name: Test
esphome_version: latest
manifest_filename: test-manifest.json
6 changes: 4 additions & 2 deletions static/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ navbar:
child :
- title : Getting Started
url : /bed-presence-mk1/getting-started
- title : ESP Web Tools
url : /bed-presence-mk1/webtools
- title : Sensor Details
url : /bed-presence-mk1/sensors
- title : ESP Web Tools
url : /webtools
- title : Store
url : https://elevatedsensors.com
# - title : Blog # Label
Expand Down
20 changes: 10 additions & 10 deletions static/bed-presence-mk1/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ subtitle: A dual bed occupancy sensor
</div>
</div>

<!-- ESP Web Tools -->
<div class="col-lg-4">
<div class="card text-left border-primary h-100">
<div class="card-body">
<h5 class="card-title">ESP Web Tools</h5>
<p class="card-text">Reflash your device with the factory image.</p>
<a href="{% link bed-presence-mk1/webtools.md%}" class="btn btn-outline-warning stretched-link">Go!</a>
</div>
</div>
</div>
<!-- <!-1- ESP Web Tools -1-> -->
<!-- <div class="col-lg-4"> -->
<!-- <div class="card text-left border-primary h-100"> -->
<!-- <div class="card-body"> -->
<!-- <h5 class="card-title">ESP Web Tools</h5> -->
<!-- <p class="card-text">Reflash your device with the factory image.</p> -->
<!-- <a href="{% link bed-presence-mk1/webtools.md%}" class="btn btn-outline-warning stretched-link">Go!</a> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
</div>

18 changes: 0 additions & 18 deletions static/bed-presence-mk1/webtools.md

This file was deleted.

35 changes: 35 additions & 0 deletions static/webtools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
layout: default
title: ESP Web Tools
header_type: post
show_breadcrumb: false
---

# Installation

You can use the button below to install the pre-built firmware directly to your device via USB from the browser. Note this has already been done from the factory. You only need to do this if you're trying to start fresh, or grap the latest updates.

<ul class="radios">
<li>
<label><input type="radio" name="type" value="bpmk1" />Bed Presence Mk1</label>
</li>
<li>
<label><input type="radio" name="type" value="test" />2nd Test Device</label>
</li>
</ul>
<p class="button-row" align="center">
<esp-web-install-button class="btn btn-outline-warning invisible"></esp-web-install-button>
</p>

<esp-web-install-button manifest="../../manifest.json"></esp-web-install-button>

<script type="module" src="https://unpkg.com/esp-web-tools@10/dist/web/install-button.js?module"></script>
<script>
document.querySelectorAll('input[name="type"]').forEach(radio =>
radio.addEventListener("change", () => {
const button = document.querySelector('esp-web-install-button');
button.manifest = `https://docs.elevatedsensors.com/${radio.value}-manifest.json`;
button.classList.remove('invisible');
}
));
</script>
67 changes: 67 additions & 0 deletions test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
substitutions:
name: bed-presence
friendly_name: Bed Presence

# Calibrate Trigger Percentile
# This controls how the trigger threshold is set during calibration. During calibration, the unoccupied and occupied
# pressure values are determined. This is the percentage of the difference between those values required to trigger
# the "occupied" state.
# - 0.75 Requires 75% of the occupied pressure to trigger (Default)
# - 0.50 Set trigger exactly in the middle of unoccupied and occupied pressures
# - 0.25 More sensitive, likely to be triggered by partner
trigger_percentile: '0.75'

# Fast Sensor Delay
# This controls how long the "Fast" sensor must register its value before updating. Without any delay, the sensor
# will register frequent fall negatives as you shift in bed.
# - 2s Same response as standard sensor
# - 500ms Good starting point for getting speed without too many false negatives (Default)
# - 0ms No delay, expect frequent false negatives
fast_delayed_off: '500ms'

esphome:
name: ${name}
friendly_name: ${friendly_name}
name_add_mac_suffix: true
project:
name: ElevatedSensors.BedPresence
version: Mk1

esp32:
board: esp32-c3-devkitm-1
framework:
type: arduino

# Allow Import
dashboard_import:
package_import_url: github://ElevatedSensors/sensor-configs/bed-presence-mk1.yaml@main
import_full_config: true

# Enable logging
logger:

# Enable Home Assistant API
api:

# Allow provisioning Wi-Fi via serial
improv_serial:

wifi:
# Set up a wifi access point
ap: {}

# In combination with the `ap` this allows the user
# to provision wifi credentials to the device via WiFi AP.
captive_portal:

# Sets up Bluetooth LE (Only on ESP32) to allow the user
# to provision wifi credentials to the device.
esp32_improv:
authorizer: none

# To have a "next url" for improv serial
web_server:

# Enable esphome OTA updates
ota:
platform: esphome

0 comments on commit a9ef327

Please sign in to comment.