rudders / homebridge-http

HTTP Plugin for Homebridge
Apache License 2.0
178 stars 110 forks source link

Realtime polling FTW! #17

Closed NovaGL closed 8 years ago

NovaGL commented 8 years ago

I tried to make it so you could easily merge it but it didn't work.

All I added was the ability to do real time polling using eg "switchHandling": "realtime",

You need to make sure you copy the package.json as well as the index.js to copy access to dependencies.

Tested and works fine for realtime power polling, motion polling and brightness polling

rudders commented 8 years ago

I'll take a look mate - will pull it all if I can. Beginning to think we should spin off a webapp http module as this is very getting pretty functional towards devices now (a good thing) I might encourage people to submit links to there forks of the README to. Thanks for your contributions!!

NovaGL commented 8 years ago

I like to look at people's forks to see if they have improved on anything, I guess that's why I forked Matt's as he did status polling first, maybe I should have put him in the contributor list.

You have no idea how much I wanted real time polling to work as it has many applications such a media player which can get now playing information.

So how exactly would it work without Homebridge?

Brightness realtime polling can be a bit strange though as if you don't let go of the slider, it keeps trying to change the value as it's constantly in flux, but hopefully that shouldn't be too much of an issue.

Would be great if we could do something using Google Now as well....

I have a working example for Contana too, which is great but I don't know C# very well so at the moment it's just a static list, and someone else did most of the work.

NovaGL commented 8 years ago

Any chance to look at this?

rudders commented 8 years ago

Sorry mate I've been time poor for a couple of weeks. I don't want to promote a change that breaks the original plugin. I'm going to be away from tomorrow for basically 2 weeks so for now you'll need to stick with your fork - why don't you do a PR on my README.md that points to your repository and spin it off as httpstatus?

NovaGL commented 8 years ago

Can you let me know how it breaks your plugin and I will revise it, it only uses my changes if you do ="realtime"

If you continue to use it as normal nothing will change, yes it does need another node module installed but I don't think that is a big deal.

Enjoy your break.

rudders commented 8 years ago

"httpstaus" change is breaking: https://github.com/NovaGL/homebridge-http-simple/commit/35d9fc81844fe520043602d82833f48a926bee66

Not sure if there is anything else but I'll be offline for a week so can't support anything else that comes up.

NovaGL commented 8 years ago

That's weird, don't know how Github works but that is not what my repo shows currently, it did show it in the sample but not anymore.

rudders commented 8 years ago

I'm no expert either and as I take another look it appears it's rolled back in a later change - I'll try and take a look tonight and fix the merge issues but might have to wait till I get back sorry mate.

NovaGL commented 8 years ago

No need to apologize just glad to know where things are at, my fault for making a crappy fork.

rudders commented 8 years ago

I could make you a contributor and you do the merge and provide support if you're up for it. No skin of my nose I just ported from legacy in the first place.

NovaGL commented 8 years ago

It's up to you, I don't forsee any further pull requests though as I think we have done as much as we can.

rudders commented 8 years ago

Feel free to merge and publish (and support for a week) or I'll do it when I get back

NovaGL commented 8 years ago

Thanks, will wait to you come back, I closed the issues as there was no point keeping them open

NovaGL commented 8 years ago

Hey, can you test this as I don't want to add the changes if it doesn't work for you.

rudders commented 8 years ago

Sorry mate - been buried in wemo-client bit the PR is going through (as of this morning) so I'll take a look. My only concern is the dependency on the called functions returning simple numeric value. Let me take a look and get back to you!

NovaGL commented 8 years ago

Cool, so everything went alright this time :)

rudders commented 8 years ago

Was all fine mate - small change here and there from memory but tim to get this change into the wild! Thanks for your patience.