-
Notifications
You must be signed in to change notification settings - Fork 50
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
Question: update when controller is viewing? #96
Comments
This is related to this: #13. It's not necessarily subscribing, but looking up. Currently there's no callback for this, but it might be worth considering to add this. Mind you; you still need to poll your device for status, as you will still be serving stale data initially. For my home, I just poll the device every 30 seconds, which is often enough to not be considered stale. You could add a callback to
|
Thanks Bouke, This is what I ended up doing to get this working. in the .GET for characteristics().swift, after the 'responses.append(response) about line 90
in 'Device.swift', I found the 'addSubscriber' func about line 400, duplicated the code and renamed both the 'func' and also the 'delegate?.'
in 'DeviceDelegate.swift' I added the following two chunks (near top and about line 80)
Finally, back in my 'main.swift' I added the following into the 'DeviceDelegate' class.
This appears to be working - as when the user opens the App, the first thing it does it GET /characteristics which then triggers the DeviceDelegate call, so I can initiate a data refresh. Kent. |
User's question:
The text was updated successfully, but these errors were encountered: