Skip to content

Commit e74d6fc

Browse files
committed
hot fixes
1 parent 33075a5 commit e74d6fc

File tree

8 files changed

+264
-84
lines changed

8 files changed

+264
-84
lines changed

custom_components/reterminal_dashboard/frontend/editor.html

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<aside class="sidebar">
2121
<div>
2222
<h1><span class="logo-dot"></span> ESPHome Designer <span
23-
style="font-size: 10px; color: var(--muted); vertical-align: middle;">v0.7.1</span></h1>
23+
style="font-size: 10px; color: var(--muted); vertical-align: middle;">v0.7.2</span></h1>
2424
<div style="margin-top: 4px; font-size: 10px;">
2525
<a href="https://github.com/koosoli/esphomedesigner" target="_blank"
2626
style="color: var(--accent); text-decoration: none; display: flex; align-items: center; gap: 4px;">
@@ -551,13 +551,29 @@ <h3>Widget properties</h3>
551551
<input id="pageSettingsName" class="prop-input" type="text" placeholder="Page name" />
552552
</div>
553553
<div class="field">
554-
<div class="prop-label">Refresh Interval (seconds)</div>
554+
<div class="prop-label">Refresh Schedule</div>
555+
<select id="pageSettingsRefreshMode" class="prop-input">
556+
<option value="interval">Periodic Interval</option>
557+
<option value="daily">Daily at specific time</option>
558+
</select>
559+
</div>
560+
561+
<div class="field" id="field-refresh-interval">
562+
<div class="prop-label">Interval (seconds)</div>
555563
<input id="pageSettingsRefresh" class="prop-input" type="number" min="0" step="1"
556564
placeholder="Auto (uses ESPHome default)" />
557565
<div style="font-size: 9px; color: var(--muted); margin-top: 2px;">
558566
Leave empty for default. Set to 0 for manual refresh only. Recommended: 60-300 seconds.
559567
</div>
560568
</div>
569+
570+
<div class="field" id="field-refresh-time" style="display:none;">
571+
<div class="prop-label">Wake Up Time</div>
572+
<input id="pageSettingsRefreshTime" class="prop-input" type="time" />
573+
<div style="font-size: 9px; color: var(--muted); margin-top: 2px;">
574+
Device will wake up at this time every day.
575+
</div>
576+
</div>
561577
<div class="field">
562578
<div class="prop-label">Dark Mode</div>
563579
<select id="pageSettingsDarkMode" class="prop-input">

custom_components/reterminal_dashboard/frontend/js/io/devices.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ window.DEVICE_PROFILES = {
1010
name: "reTerminal E1001 (Monochrome)",
1111
displayModel: "7.50inv2p",
1212
displayPlatform: "waveshare_epaper",
13+
psram_mode: "octal",
1314
pins: {
1415
display: { cs: "GPIO10", dc: "GPIO11", reset: { number: "GPIO12", inverted: false }, busy: { number: "GPIO13", inverted: true } },
1516
i2c: { sda: "GPIO19", scl: "GPIO20" },
@@ -35,6 +36,7 @@ window.DEVICE_PROFILES = {
3536
name: "reTerminal E1002 (6-Color)",
3637
displayModel: "Seeed-reTerminal-E1002",
3738
displayPlatform: "epaper_spi",
39+
psram_mode: "octal",
3840
pins: {
3941
display: { cs: null, dc: null, reset: null, busy: null },
4042
i2c: { sda: "GPIO19", scl: "GPIO20" },
@@ -81,8 +83,6 @@ window.DEVICE_PROFILES = {
8183
sht4x: false
8284
}
8385
},
84-
<<<<<<< Updated upstream
85-
=======
8686
m5stack_coreink: {
8787
name: "M5Stack CoreInk (200x200)",
8888
displayModel: "1.54in-m5coreink-m09",
@@ -162,7 +162,6 @@ window.DEVICE_PROFILES = {
162162
" - source: github://Passific/m5paper_esphome"
163163
]
164164
},
165-
>>>>>>> Stashed changes
166165
esp32_s3_photopainter: {
167166
name: "Waveshare PhotoPainter (6-Color)",
168167
displayModel: "7.30in-f",

custom_components/reterminal_dashboard/frontend/js/io/hardware_generators.js

Lines changed: 58 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
// HARDWARE SECTION GENERATORS
33
// ============================================================================
44

5-
function generateTouchscreenSection(profile) {
5+
function generateTouchscreenSection(profile, displayId = "my_display") {
66
if (!profile.touch) return []; // E-paper usually has no touch or handled differently
77

88
const t = profile.touch;
99
const lines = ["touchscreen:"];
1010
lines.push(` - platform: ${t.platform}`);
1111
lines.push(` id: my_touchscreen`);
12-
lines.push(` display: my_display`); // Assumes display ID is my_display (LCDs)
12+
lines.push(` display: ${displayId}`);
1313

1414
if (t.i2c_id) lines.push(` i2c_id: ${t.i2c_id}`);
1515
if (t.spi_id) lines.push(` spi_id: ${t.spi_id}`);
@@ -191,6 +191,7 @@ function generateSPISection(profile) {
191191
function generateDisplaySection(profile) {
192192
const lines = [];
193193

194+
194195
// Display Platform Configuration
195196
if (profile.display_config) {
196197
lines.push("display:");
@@ -219,7 +220,19 @@ function generateDisplaySection(profile) {
219220
addPin("reset_pin", p.reset);
220221
addPin("busy_pin", p.busy);
221222

222-
if (profile.displayModel) lines.push(` model: "${profile.displayModel}"`);
223+
if (profile.displayModel === "M5Paper" || profile.displayPlatform === "it8951e") {
224+
lines.push(" rotation: 0");
225+
lines.push(" reversed: false");
226+
lines.push(" reset_duration: 100ms");
227+
}
228+
else if (profile.displayModel) {
229+
let modelLine = ` model: "${profile.displayModel}"`;
230+
// Add warning for E1002 consumers using older ESPHome versions
231+
if (profile.displayModel === "Seeed-reTerminal-E1002") {
232+
modelLine += " #Please update your ESPHome version to 2025.11.1 above";
233+
}
234+
lines.push(modelLine);
235+
}
223236

224237
lines.push(" update_interval: never");
225238

@@ -245,7 +258,9 @@ function generateDisplaySection(profile) {
245258
}
246259

247260
// Add Touchscreen if present
248-
lines.push(...generateTouchscreenSection(profile));
261+
// Fallback generation (e-paper) uses epaper_display, custom/LCD likely uses my_display
262+
const linkedDisplayId = profile.display_config ? "my_display" : "epaper_display";
263+
lines.push(...generateTouchscreenSection(profile, linkedDisplayId));
249264

250265
// Note: Backlight section is generated in yaml_export.js, not here (to avoid duplicates)
251266

@@ -341,9 +356,15 @@ function generateBinarySensorSection(profile, numPages, displayId = "my_display"
341356
if (b.left) {
342357
lines.push(" - platform: gpio"); // Left Button
343358
lines.push(` pin:`);
344-
lines.push(` number: ${b.left}`);
345-
lines.push(` mode: INPUT_PULLUP`);
346-
lines.push(` inverted: true`);
359+
if (typeof b.left === 'object') {
360+
lines.push(` number: ${b.left.number}`);
361+
lines.push(` mode: ${b.left.mode || 'INPUT_PULLUP'}`);
362+
lines.push(` inverted: ${b.left.inverted !== undefined ? b.left.inverted : true}`);
363+
} else {
364+
lines.push(` number: ${b.left}`);
365+
lines.push(` mode: INPUT_PULLUP`);
366+
lines.push(` inverted: true`);
367+
}
347368
lines.push(" name: \"Left Button\"");
348369
lines.push(" id: button_left");
349370
lines.push(" on_press:");
@@ -362,9 +383,15 @@ function generateBinarySensorSection(profile, numPages, displayId = "my_display"
362383
if (b.right) {
363384
lines.push(" - platform: gpio"); // Right Button
364385
lines.push(` pin:`);
365-
lines.push(` number: ${b.right}`);
366-
lines.push(` mode: INPUT_PULLUP`);
367-
lines.push(` inverted: true`);
386+
if (typeof b.right === 'object') {
387+
lines.push(` number: ${b.right.number}`);
388+
lines.push(` mode: ${b.right.mode || 'INPUT_PULLUP'}`);
389+
lines.push(` inverted: ${b.right.inverted !== undefined ? b.right.inverted : true}`);
390+
} else {
391+
lines.push(` number: ${b.right}`);
392+
lines.push(` mode: INPUT_PULLUP`);
393+
lines.push(` inverted: true`);
394+
}
368395
lines.push(" name: \"Right Button\"");
369396
lines.push(" id: button_right");
370397
lines.push(" on_press:");
@@ -383,9 +410,15 @@ function generateBinarySensorSection(profile, numPages, displayId = "my_display"
383410
if (b.refresh) {
384411
lines.push(" - platform: gpio"); // Refresh Button
385412
lines.push(` pin:`);
386-
lines.push(` number: ${b.refresh}`);
387-
lines.push(` mode: INPUT_PULLUP`);
388-
lines.push(` inverted: true`);
413+
if (typeof b.refresh === 'object') {
414+
lines.push(` number: ${b.refresh.number}`);
415+
lines.push(` mode: ${b.refresh.mode || 'INPUT_PULLUP'}`);
416+
lines.push(` inverted: ${b.refresh.inverted !== undefined ? b.refresh.inverted : true}`);
417+
} else {
418+
lines.push(` number: ${b.refresh}`);
419+
lines.push(` mode: INPUT_PULLUP`);
420+
lines.push(` inverted: true`);
421+
}
389422
lines.push(" name: \"Refresh Button\"");
390423
lines.push(" id: button_refresh");
391424
lines.push(" on_press:");
@@ -555,7 +588,18 @@ function generateOutputSection(profile) {
555588
lines.push("output:");
556589
if (profile.pins.batteryEnable) {
557590
lines.push(" - platform: gpio"); // Use standard gpio output
558-
lines.push(` pin: ${profile.pins.batteryEnable}`);
591+
if (typeof profile.pins.batteryEnable === 'object') {
592+
lines.push(" pin:");
593+
lines.push(` number: ${profile.pins.batteryEnable.number}`);
594+
if (profile.pins.batteryEnable.ignore_strapping_warning) {
595+
lines.push(" ignore_strapping_warning: true");
596+
}
597+
if (profile.pins.batteryEnable.inverted !== undefined) {
598+
lines.push(` inverted: ${profile.pins.batteryEnable.inverted}`);
599+
}
600+
} else {
601+
lines.push(` pin: ${profile.pins.batteryEnable}`);
602+
}
559603
lines.push(" id: bsp_battery_enable");
560604
// Often good to set restore_mode or inverted if needed
561605
// For now matching legacy exactly

0 commit comments

Comments
 (0)