Skip to content

Fixes/modernize#170

Merged
MichaelB2018 merged 4 commits intoNickduino:masterfrom
MichaelB2018:fixes/modernize
Mar 26, 2026
Merged

Fixes/modernize#170
MichaelB2018 merged 4 commits intoNickduino:masterfrom
MichaelB2018:fixes/modernize

Conversation

@MichaelB2018
Copy link
Copy Markdown
Collaborator

Modernize frontend and restructure backend

Summary

Full modernization of the Pi-Somfy project — updated web interface, restructured backend, and numerous bug fixes.

Web Interface

  • Modernized design with a mobile-friendly, responsive layout that works well on phones, tablets, and desktops
  • Replaced all bitmap button icons with crisp vector (SVG) graphics
  • Consolidated 20+ favicon formats into a single SVG favicon
  • Fixed schedule page visual glitches: toggle labels, clock picker positioning, and dropdown menus clipping
  • Fixed a bug where deleting a schedule and then adding a new one could fail
  • Removed dependency on external icon font files (Bootstrap Icons webfont)
  • Fixed 27 spelling mistakes

Alexa Integration

  • No restart required: Adding or removing shutters via the web UI is now automatically picked up by Alexa — no service restart needed
  • More reliable device discovery (responses sent multiple times to guard against network packet loss)

MQTT / Home Assistant

  • Updated to the modern Home Assistant MQTT discovery format
  • Now compatible with both paho-mqtt 1.x and 2.x

Backend

  • Consolidated 9 Python files into 6 (cleaner structure, less duplication)
  • Configuration file writes are now safer — protected against corruption from power loss or crashes
  • Fixed several bugs in the scheduler, configuration reader, and shutter control (demo mode)
  • Updated deprecated Python API calls for compatibility with current Python versions
  • Can now run on Windows for development/testing (web server and Alexa work; GPIO requires a Pi)

Housekeeping

  • Added .gitignore entries for user config and log files (contain personal data)
  • Removed unused fauxmo_config.json
  • Removed unused CSS/JS library files (functionality replaced with inline code)
  • Net reduction of ~2,100 lines of code

Testing

  • Tested on Windows (web interface + Alexa discovery)
  • Tested on Raspberry Pi (full stack including Alexa voice control)

- mymqtt.py: Support both paho-mqtt 1.x and 2.x by detecting
  CallbackAPIVersion (addresses PR Nickduino#164 by @digitalgravy)
- myconfig.py: Uppercase shutterId when writing rolling codes to prevent
  duplicate config entries with hex IDs (addresses PR Nickduino#156 by @gbsallery
  and PR Nickduino#159 by @malys)
- README.md: Credit community contributors
- Add .github/agents/pi-somfy.agent.md for development workflow
- Replace Bootstrap 3.3.7 with Bootstrap 5.3.3
- Replace jQuery 3.3.1 with jQuery 4.0.0
- Replace Glyphicons with Bootstrap Icons 1.11.3
- Replace bootstrap-dialog plugin with native BS5 modal shim
- Convert all panel markup to BS5 accordion components
- Update all data-toggle/data-dismiss/data-target to data-bs-* attributes
- Update modal markup to BS5 (modal-dialog-centered, btn-close)
- Update CSS: remove vendor prefixes for old browsers, use BS5 classes
- Fix nested accordion parent reference (was #accordion, now #configAccordion)
- Fix stray </script> tag before </html>
- Remove old files: BS3 CSS/JS, jQuery 3.3.1, Glyphicons fonts, npm.js,
  bootstrap-dialog CSS/JS, bootstrap-theme, all source maps
Web Interface:
- Modernized design with mobile-friendly layout
- Replaced bitmap icons with SVG vector graphics
- Fixed schedule page visual glitches (toggles, clock picker, dropdowns)
- Fixed delete-then-add schedule bug
- Fixed 27 spelling mistakes

Backend:
- Consolidated 9 Python modules into 6 (renamed and merged)
- Alexa: dynamic device registration (no restart needed for new shutters)
- Alexa: more reliable discovery (multi-send responses)
- MQTT: updated to modern Home Assistant discovery format
- Config: safer file writes, thread-safe access
- Fixed bugs in scheduler, config reader, and shutter control
- Windows development support (Alexa + web server)
- Updated deprecated Python API calls

Housekeeping:
- .gitignore: exclude user config and log files
- Removed unused fauxmo_config.json
- Replaced 20+ favicon formats with single SVG
- Removed unused CSS/JS libraries (replaced with inline code)
@Nickduino
Copy link
Copy Markdown
Owner

Impressive work, @MichaelB2018

@Nickduino
Copy link
Copy Markdown
Owner

Nickduino commented Mar 26, 2026

Tested ok on my Raspberry Pi B+.

I've had to install paho-mqtt, even though I'm not using MQTT. Maybe that could be optional?

@MichaelB2018
Copy link
Copy Markdown
Collaborator Author

Good catch on paho-mqtt — this was unintentional. I've included the fix in feature release PR #171.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants