vanstinator / raincloudy

RainCloudy is a library written in Python 3.x that manages the Melnor RainCloud Smart Garden Watering Irrigation Timer.
Apache License 2.0
24 stars 7 forks source link

WIP: Add support for N controllers and N valves per-controller. #42

Closed vanstinator closed 4 years ago

vanstinator commented 5 years ago

WIP PR for #22 so I can self-review and run CI as I go.

EDIT: Fixes #41 and closes #22

Currently implemented the bare-minimum handling needed to iterate through any number of valves and controllers. The following demonstration code should work for all users on this current iteration of the PR:

from raincloudy.core import RainCloudy

raincloud = RainCloudy(username='EMAIL', password='PASSWORD')

for controller in raincloud.controllers:
    print('\nController: ' + controller.name)
    for faucet in controller.faucets:
        print('\nFaucet: ' + faucet.name)
        for zone in faucet.zones:
            print('Zone: ' + zone.name)
vanstinator commented 5 years ago

So I was debugging tonight and starting to test the various attribute setters and they just weren't working. Turns out you need to hit /home twice if you're not already on the selected controller/faucet combo. It ignores the rest of the form fields otherwise šŸ¤¦ā€ā™‚

vanstinator commented 5 years ago

Getting closer. All the functionality I've currently tested works. I also swapped out the BeautifulSoup html parser for html5lib. It makes parsing the broken (šŸ™„) html so much better. Resulted in less kludgy code in the refactored helpers. I'll do another pass after this lands to clean up anything else that will benefit.

harryohalloran commented 5 years ago

I have now been using home assistant with my controller and one valve for awhile without issue and just got an additional valve which broke everything in home assistant. Happy to test this when ready.

JangoBritt commented 5 years ago

@vanstinator, bit of radio silence for a couple of months on this PR.

Anywhere closer to success? It looks like you said you were close, but this hasn't been merged yet?

JangoBritt commented 5 years ago

Hey @vanstinator, I don't mean to bug you, but are you still working on this PR? Is it ready to merge and we're just waiting for @tchellomello?

JangoBritt commented 5 years ago

@vanstinator Is there any way we can implement your awaiting changes, in hassio without having to wait for the PR to be merged?

JangoBritt commented 4 years ago

Heeeeeyyyy @vanstinator ... I know it's the off-season here in Europe, and I'm sorry for being that guy, but any progress on merging this PR?

harryohalloran commented 4 years ago

@vanstinator Is there any way we can implement your awaiting changes, in hassio without having to wait for the PR to be merged?

@jangobritt Did you ever figure this out? Now that the weather is getting nicer in Chicago Iā€™m hoping I CNA get both valves working in hassio.

JangoBritt commented 4 years ago

Hi all. I hope you're all doing well.

No, I didn't get round to figuring this out. I hoped by the time we needed sprinklers around here, there's be more progress.

If anyone's bored on lockdown, this'd be a great PR to pass the time on? ;-)

Stay Safe!

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-2.6%) to 94.019% when pulling 7a3b22127bdd74af44d7cc0232101e144aba1399 on feature/multiple-units into 36e0e1a16932bfd8e5c257d0fc1e5a42bd2f1214 on master.

vanstinator commented 4 years ago

There are known issues. But it's ready enough to start putting together the home assistant bits. Merging.