-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HomeKit support #501
Comments
A possible issue is that HomeKit is a catalyst framework. That said, AFAIK it is possible to mix usage of catalyst in cocoa in applications. |
The following has limited success: import objc
objc.loadBundle('HomeKit', globals(), '/System/Library/PrivateFrameworks/HomeKit.framework')
manager = HMHomeManager.new()
print(manager.homes()) This works, but prints an empty set of homes even though I see a "home" in Home.app. Loading Using
Some very short research seems to indicate that it is possible to load an AppKit extension into a Catalyst app, but that it is at best a lot harder to do it the other way around (https://indiedevmonday.com/issue-18, https://github.com/steventroughtonsmith/airqualitymonitor, https://twitter.com/stroughtonsmith/status/1313474865467453441). More importantly: https://developer.apple.com/forums/thread/692356, which contains a definitive statement from an Apple engineer that says loading Catalyst frameworks into an AppKit app is not possible. That sadly means that using the HomeKit framework requires either using the private HomeKit framework (assuming that can be made to work), or creating a Catalyst version of Python + PyObjC. That's something I'd like to look into, but I have no idea when. |
A Catalyst version of Python would be an interesting proposition, but is something that will require coordinating with at least the PyPA and PyPI maintainers, as well as with CPython to upstream relevant patches (including CI support). A major disadvantage of a Catalyst Python is that it likely cannot use existing binary wheels. |
I've added an issue about a Catalyst build to the CPython project: python/cpython#98297 To be honest I expect little progress on that until I get around to work on this myself (assuming I do get around to that). |
Is your feature request related to a problem? Please describe.
Nope, just hoping to use the framework.
Describe the solution you'd like
Would it be possible to just get
from HomeKit import HMHomeManager
to work?Describe alternatives you've considered
The various HomeKit libraries in Python seem to be for cutting Apple out of the loop entirely (implementing a controller on Linux or emulating an accessory), so I don't think there's something that does this.
The text was updated successfully, but these errors were encountered: