Skip to content

Add Python support to Homey CLI#541

Merged
jeroenwienk merged 58 commits intodevelopfrom
feature/python
Mar 9, 2026
Merged

Add Python support to Homey CLI#541
jeroenwienk merged 58 commits intodevelopfrom
feature/python

Conversation

@WeeJeWel
Copy link
Copy Markdown
Contributor

This PR adds functionality to run Python-based apps with Homey CLI.

@JELoohuis JELoohuis force-pushed the feature/python branch 8 times, most recently from 967f707 to adf75f2 Compare November 18, 2025 12:23
@JELoohuis JELoohuis force-pushed the feature/python branch 2 times, most recently from 3a4919b to 4b2424f Compare November 25, 2025 10:49
@JELoohuis JELoohuis marked this pull request as ready for review January 6, 2026 14:39
@JELoohuis
Copy link
Copy Markdown
Contributor

NOTE: the minimum software version for the Homey pro that supports Python has been set to 0.0.0 as a placeholder. This will need to be changed to the first actual version once it is released.

@JELoohuis JELoohuis marked this pull request as draft January 6, 2026 16:13
@JELoohuis JELoohuis marked this pull request as ready for review January 6, 2026 16:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive Python support to Homey CLI, enabling developers to create, build, and run Python-based Homey apps alongside existing Node.js apps. The implementation introduces a factory pattern to handle different runtimes while preserving backward compatibility.

Changes:

  • Introduced AppFactory to instantiate the correct app class based on runtime (Node.js or Python)
  • Added AppPython class with Python-specific build, dependency management, and containerization logic
  • Extracted Docker operations into a reusable DockerHelper utility class
  • Refactored App class methods to support polymorphism across runtimes

Reviewed changes

Copilot reviewed 12 out of 36 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
package.json Added dotenv and smol-toml dependencies for Python environment and manifest parsing
lib/StacklessError.js New error class that suppresses stack traces for cleaner user-facing errors
lib/HomeyCompose.js Added method to create Homey Compose directory structure
lib/DockerHelper.js New utility class extracting Docker operations from App.js
lib/AppPython.js New class implementing Python app lifecycle management
lib/AppFactory.js New factory class to instantiate appropriate app class based on runtime
lib/App.js Refactored to extract Docker logic and support runtime polymorphism
assets/templates/app/widgets/api.py Python template for widget API endpoints
assets/templates/app/drivers/driver.py Python template for driver implementation
assets/templates/app/drivers/device.py Python template for device implementation
assets/templates/app/app.py Python template for main app class
.github/CODEOWNERS Removed empty CODEOWNERS file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/DockerHelper.js
Comment thread lib/DockerHelper.js
Comment thread lib/AppPython.js Outdated
Comment thread lib/AppPython.js Outdated
Comment thread lib/AppPython.js
Comment thread lib/AppPython.js
Comment thread lib/App.js
Comment thread lib/App.js
@JELoohuis
Copy link
Copy Markdown
Contributor

Depends on athombv/node-homey-lib#639

@JELoohuis JELoohuis requested a review from RobinBol February 10, 2026 10:47
hmeerlo and others added 11 commits February 12, 2026 17:16
Simplifies compatibility logic by only requiring the API version
to be 3, allowing broader support for Python apps on Homey
devices regardless of platform version.
Removes reference to Homey Cloud in the error message to accurately reflect that Python apps are unsupported only on Homey Pro (2016—2019), improving clarity for users.
…ture/python

# Conflicts:
#	package-lock.json
#	package.json
@jeroenwienk jeroenwienk merged commit 6003b1d into develop Mar 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

7 participants