Skip to content
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

Changing the State of an Accessory "Outside of HomeKit" #405

Open
AlexMaghen opened this issue Apr 1, 2022 · 1 comment
Open

Changing the State of an Accessory "Outside of HomeKit" #405

AlexMaghen opened this issue Apr 1, 2022 · 1 comment

Comments

@AlexMaghen
Copy link

I'm using your GarageDoor example and I have it working but I am confused about one thing: In the very simple Python file I've included, the "GarageDoor" class's change_state() function gets called beautifully when a user taps on the accessory in iOS Home (or wherever). But what happens if the door changes state for other reasons (user opens it manually, whatever)? I don't understand how I instruct the accessory that I've created that it's status HAS CHANGED from inside my code. I think I need to use an Accessory base class function but I'm having trouble understanding this from the documentation.

Anyone's help most appreciated with this amazing library!

Ale
Garagey.txt
x

@Pythonaire
Copy link

two ways:

  1. permanent polling the device (i think, not a good idea), described as "service callback" (@Acessory.run_at_interval(3)).
  2. let the device inform HAP-Python about state change. See the http.py example.
    I use 433 MHz devices instead of Wifi, to communicate over longer distance. A device as an example send state changes, HAP-Python forward this to the homekit. https://github.com/Pythonaire/HAP-Python-RFM69

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

No branches or pull requests

2 participants