52 Commits

Author SHA1 Message Date
ThaMunsta 905b54803d maybe now
Build Images and Deploy / Update-PROD-Stack (push) Successful in 18s
2026-04-06 21:01:48 -04:00
ThaMunsta b724e805dd better fix for toggle?
Build Images and Deploy / Update-PROD-Stack (push) Successful in 19s
2026-04-06 20:58:43 -04:00
ThaMunsta 93dc2952ec testing fixes for toggles and sockets
Build Images and Deploy / Update-PROD-Stack (push) Successful in 20s
2026-04-06 20:55:29 -04:00
ThaMunsta cd0ca8cf7c web sockety things
Build Images and Deploy / Update-PROD-Stack (push) Successful in 19s
2026-03-30 23:21:23 -04:00
ThaMunsta 0a4ff9bf76 holy shit toggle button
Build Images and Deploy / Update-PROD-Stack (push) Successful in 19s
2026-03-30 23:15:35 -04:00
ThaMunsta 5180b3bce1 on off toggle fix
Build Images and Deploy / Update-PROD-Stack (push) Successful in 19s
2026-03-30 23:12:48 -04:00
ThaMunsta d7e9f0d3d3 state is still being weird
Build Images and Deploy / Update-PROD-Stack (push) Successful in 19s
2026-03-30 23:09:04 -04:00
ThaMunsta f7c952cec4 toggle button state on load
Build Images and Deploy / Update-PROD-Stack (push) Successful in 19s
2026-03-30 22:59:49 -04:00
ThaMunsta 9e6101dc3c another shot at brightness adjustments
Build Images and Deploy / Update-PROD-Stack (push) Successful in 19s
2026-03-30 22:57:42 -04:00
ThaMunsta 0bb3398097 toggle button fixes
Build Images and Deploy / Update-PROD-Stack (push) Successful in 19s
2026-03-30 22:44:34 -04:00
ThaMunsta 7ea32cee8c bugfix for rule fetch, feat: device info and trying to fix dimmer
Build Images and Deploy / Update-PROD-Stack (push) Successful in 18s
2026-03-30 22:38:52 -04:00
ThaMunsta 5bffb1064d more debug logs
Build Images and Deploy / Update-PROD-Stack (push) Successful in 11s
2026-03-30 22:29:18 -04:00
ThaMunsta da2693ae68 dimming and fix for manual add
Build Images and Deploy / Update-PROD-Stack (push) Successful in 19s
2026-03-30 22:16:17 -04:00
ThaMunsta 70c98af759 manual add button
Build Images and Deploy / Update-PROD-Stack (push) Successful in 18s
2026-03-30 22:10:30 -04:00
ThaMunsta 0977a610ff change compose files
Build Images and Deploy / Update-PROD-Stack (push) Successful in 19s
2026-03-30 22:05:21 -04:00
ThaMunsta ab17324f85 feat: add deployment workflows for web, Android, Docker, macOS, and Linux
Build Images and Deploy / Update-PROD-Stack (push) Successful in 34s
2026-03-30 22:00:36 -04:00
SRS IT f5e69fa9cd Fix Android workflow: add contents:write permission for release upload
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 18:29:56 -04:00
SRS IT fe48f9b465 Add Android Capacitor app and build workflow
- apps/android/: Capacitor project wrapping the mobile web UI
- www/index.html: full DWM remote UI with first-run server IP setup screen
- capacitor.config.json: app ID com.dibby.wemo, allowMixedContent enabled
- .github/workflows/build-android.yml: builds debug APK on Ubuntu via Gradle

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 18:20:27 -04:00
SRS IT 3480c75f4c feat: add macOS build, Docker image, and CI workflows
macOS (.dmg):
- Add mac build config to apps/desktop/package.json (x64 + arm64 DMGs)
- .github/workflows/build-mac.yml — builds on macos-latest, uploads to release

Docker (headless scheduler + web remote):
- docker/server.js — Node.js entry point using homebridge-plugin lib;
  REST API + WebSocket, serves mobile web UI on PORT (default 3456)
- docker/package.json — production deps (adm-zip, axios, sql.js, ws, xml2js, xmlbuilder2)
- Dockerfile — node:20-alpine image; VOLUME /data for persistent config
- .github/workflows/build-docker.yml — builds linux/amd64+arm64,
  pushes to ghcr.io/k0rb3nd4ll4s/dibby-wemo-manager

Usage:
  docker run -d --network host -v /opt/wemo:/data \
    ghcr.io/k0rb3nd4ll4s/dibby-wemo-manager:latest

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 16:27:03 -04:00
SRS IT 58f2724d17 fix: add contents:write permission for release uploads 2026-03-29 15:31:27 -04:00
SRS IT 05079ca545 fix: remove arch from linux targets — let CLI --x64/--arm64 flag control arch 2026-03-29 14:38:32 -04:00
SRS IT 129f22a785 fix: add homepage field required by electron-builder deb/rpm targets 2026-03-29 14:27:21 -04:00
SRS IT 020d43396f fix: add --publish never to prevent electron-builder auto-publish in CI 2026-03-29 14:23:23 -04:00
SRS IT fb688bdfd3 fix: disable npm native module rebuild in electron-builder
All production deps (sql.js, ws, xml2js, etc.) are pure JS or WASM —
none need native rebuilding for the Electron runtime. Disabling npmRebuild
skips the @electron/rebuild step that was failing to find
app-builder-lib/out/util/rebuild/remote-rebuild.js in CI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 12:41:12 -04:00
SRS IT 0aac2b60eb fix: copy bundled app-builder binary to system PATH instead of downloading
app-builder-bin v5 alpha ships the binary inside the npm package itself
(no GitHub release assets). Copy the npm-bundled binary to /usr/local/bin
using the path from require('app-builder-bin').appBuilderPath so
USE_SYSTEM_APP_BUILDER=true can find it in PATH.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 12:35:39 -04:00
SRS IT d8c32b438f fix: install app-builder to system PATH, use USE_SYSTEM_APP_BUILDER
The binary disappears from node_modules between the verify step and the
electron-builder step (likely re-installed/cleared during dep scan).
Install it to /usr/local/bin/ and use USE_SYSTEM_APP_BUILDER=true so
electron-builder looks it up by name in PATH — bypassing all path
resolution and caching issues.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 12:10:20 -04:00
SRS IT 2e9dade24f fix: use CUSTOM_APP_BUILDER_PATH to resolve app-builder binary in CI
app-builder-bin/index.js supports CUSTOM_APP_BUILDER_PATH env var which
overrides the default binary resolution. Set this explicitly on both
Linux build steps to ensure electron-builder finds the binary regardless
of working directory or npm workspace hoisting quirks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 11:20:29 -04:00
SRS IT c5501c945f debug: diagnose app-builder path from desktop working directory 2026-03-29 00:06:51 -04:00
SRS IT e79ff02141 fix: add app-builder binary download step to Linux workflow
The postinstall script for app-builder-bin does not download the binary
automatically in the GitHub Actions environment. Add an explicit step
to download and chmod the binary before running electron-builder.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 00:04:28 -04:00
SRS IT 37f4a4ea25 fix: move node-windows to optionalDependencies to fix Linux CI build
app-builder runs npm install --production inside the app dir during
packaging. node-windows has a Windows-only postinstall script that
fails on Linux with ENOENT. Moving it to optionalDependencies makes
npm treat install failures as non-fatal on non-Windows platforms.

Also simplify build-linux.yml — removes unnecessary app-builder binary
verification steps that were masking the actual root cause.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 23:56:26 -04:00
SRS IT 7bd3a81bda feat: port countdown/away action features to Windows desktop app
- CountdownEditor: new Condition dropdown (ON->OFF / OFF->ON)
- AwayModeEditor: Window Start/End Action dropdowns
- RuleEditor: persist countdownAction field
- scheduler: countdown now state-change-driven with window check;
  away mode respects startAction/endAction; _stopAwayLoop uses endAction

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 23:19:16 -04:00
SRS IT 3c155f7cfd feat: add active time window to countdown rules
UI: Active Window Start/End time inputs on countdown form.
Leave blank = runs any time. End before start = crosses midnight.
Scheduler: checks current time against window before starting timer;
supports cross-midnight windows (e.g. 9:00 AM to 4:00 AM next day).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 22:32:29 -04:00
SRS IT e8b365e5a7 feat: persist and cache all known devices; discovery only adds/updates
- Store.mergeDevices(): updates existing by UDN, adds new, keeps offline devices
- platform.js: merges discovered into cache; registers cached-offline devices
  in HomeKit so they remain visible; only removes truly orphaned accessories
- server.js: discover endpoint merges and returns full known device list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 22:28:11 -04:00
SRS IT e52b3578dc feat: countdown rule fires only when device matches configured condition
Countdown is now state-change-driven (no scheduled window):
- 'If turns ON → auto-OFF after duration' (on_to_off)
- 'If turns OFF → auto-ON after duration' (off_to_on)
Scheduler polls device state; timer only starts when state matches
the chosen condition. Cancels any pending timer if state changes again.
Away Mode startAction/endAction already wired; _stopAwayLoop uses endAction.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 22:24:11 -04:00
SRS IT 5024996523 fix: simplify countdown action to plain Turn ON / Turn OFF, no auto-reverse 2026-03-28 22:17:14 -04:00
SRS IT 4c09fd0b66 feat: add ON/OFF action config for Countdown and Away rules in Homebridge plugin
- Countdown: new 'Action when timer fires' dropdown (Turn ON / Turn OFF);
  scheduler uses rule.countdownAction instead of hardcoded 1/0
- Away Mode: scheduler now reads startAction/endAction from the rule
  (UI already exposed these fields); _stopAwayLoop respects endAction
  instead of always forcing OFF at window end

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 22:15:01 -04:00
SRS IT 2f9f68eca7 debug: add pre-build ldd/file diagnostics before electron-builder 2026-03-28 21:35:03 -04:00
SRS IT 4f4d2a7b61 fix: install from workspace root; add robust app-builder binary fallback 2026-03-28 21:26:52 -04:00
SRS IT b3af43120d fix: install in apps/desktop dir, add ldd debug for app-builder binary 2026-03-28 21:00:30 -04:00
SRS IT 817b91960c fix: use electronuserland/builder Docker image for Linux builds
The app-builder binary (electron-builder's internal tool) fails to spawn
on plain ubuntu-latest runners due to missing shared libraries.

The official electronuserland/builder Docker image has all required
dependencies pre-installed and is the recommended build environment.
This eliminates the ENOENT spawn error entirely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 20:52:59 -04:00
SRS IT c9ae546d4a fix: use plain npm install, verify app-builder binary separately
- Remove --ignore-scripts (it prevented app-builder-bin postinstall)
- Add binary verification step with fallback postinstall
- Use npm_config_node_windows_skip_install env var for node-windows
- Keep CSC_IDENTITY_AUTO_DISCOVERY=false to skip code signing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 20:48:44 -04:00
SRS IT 9b1a81b968 fix: download app-builder binary explicitly after --ignore-scripts install
--ignore-scripts skipped app-builder-bin postinstall which downloads the
electron-builder binary, causing ENOENT at build time.
Add explicit step: node node_modules/app-builder-bin/install.js

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 20:45:55 -04:00
SRS IT 2790f5a82d fix: robust Linux CI — root workspace install, split build steps, skip codesign
- npm install at root with --ignore-scripts --legacy-peer-deps
  (prevents node-windows and other Windows postinstall scripts failing)
- CSC_IDENTITY_AUTO_DISCOVERY=false disables electron-builder cert search
- Split vite build, standalone bundle, and electron-builder into separate steps
  so failures are easier to identify in CI logs
- Added libarchive-tools for AppImage generation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 20:41:44 -04:00
SRS IT a33a97cefc fix: scope Linux build to desktop workspace, skip Windows postinstall scripts
- Run npm install --ignore-scripts inside apps/desktop only
  (avoids node-windows postinstall breaking on Ubuntu runner)
- Run electron-rebuild explicitly after install
- Run build commands directly in apps/desktop working directory
- arm64 reuses vite output from x64 build step

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 20:36:55 -04:00
SRS IT 5a5155c216 chore: add root package.json, lock files, and gitignore *.tgz
- Root package.json (workspace definition) was missing from initial commit
- Commit root package-lock.json for reproducible installs
- Commit packages/homebridge-plugin/package-lock.json
- Add *.tgz to .gitignore (built npm tarballs are release assets, not source)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 20:34:13 -04:00
SRS IT 3bcc427683 feat: add Import/Export for DWM rules in Homebridge UI
Export:
- '⬇ Export' button downloads all rules as dwm-rules-YYYY-MM-DD.json
- Compatible with desktop app rule format

Import:
- '⬆ Import' button opens file picker (accepts .json)
- Preview panel shows rule names + types before committing
- Merge mode: adds rules, skips any whose name already exists
- Replace mode: deletes all current rules then imports
- Server strips imported IDs/timestamps — fresh ones are assigned
- Reports imported/skipped count on completion

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 20:25:12 -04:00
SRS IT 951d4c4eaa feat: add sunrise/sunset support to Homebridge plugin
Scheduler:
- Import sun.js calculator (already existed, never wired in)
- resolveSecs() maps -2=sunrise/-3=sunset sentinels + offset to actual seconds
- getTodaySun() reads stored location from store
- _loadSchedule(), _resumeAwayLoops(), _startAwayLoop() all resolve sun times

Server:
- Add /sun-times endpoint returning today's sunrise/sunset in seconds

UI:
- Start Time and End Time fields now show Fixed/Sunrise/Sunset dropdown
- Offset field (minutes before/after) shown when sun type selected
- Live preview shows today's base time + fires-at time with offset
- Save handler writes -2/-3 sentinels + startType/endType/startOffset/endOffset
- openDwmEdit() restores sun type and offset when editing existing rules

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 20:20:32 -04:00
SRS IT b200c45385 Fix: resolve sunrise/sunset times in desktop scheduler
Sun-based rules (startTime -2=sunrise, -3=sunset) were silently skipped
with 'if (startSecs < 0) continue'. The sun.js calculator existed but
was never called.

- Import calcSunTimes from ./core/sun
- Compute today's sunrise/sunset once at start of _loadSchedule()
- resolveSecs() maps -2/-3 sentinels to actual seconds + offset
- Both Away Mode and Schedule sections now fire at correct sun times
- Rules with no location set continue to be skipped gracefully

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 20:15:18 -04:00
SRS IT 3fa94ea6e3 Fix: remove npm cache from workflow (no lock file in repo)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 18:28:05 -04:00
SRS IT 3d98f684cf Add GitHub Actions workflow to build and upload Linux packages
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 17:48:56 -04:00