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

Accessing objects if we only have a single controller/valve #44

Closed bdwilson closed 4 years ago

bdwilson commented 4 years ago

Hi, I'm trying to use this code with a single device and having issues. This used to work:

raincloudy = RainCloudy(config['email'], config['password']) controller = raincloudy.controller.status battery=raincloudy.controller.faucet.battery

I get this: AttributeError: 'RainCloudy' object has no attribute 'controller'

If I need to be addressing these objects differently for a single device/faucet, let me know - perhaps the docs could be updated to show how to address multiple vs. single controllers/faucets.

Thank you for picking this code back up!

vanstinator commented 4 years ago

I need to update the docs.

bdwilson commented 4 years ago

Thanks. I wish I was better about understanding how python works. Examples make it easy, though - here is how you get controllers, here is how you get valves on a particular controller, etc. Sorry I can’t translate it as-is, but appreciate the work you’ve done on it!

bdwilson commented 4 years ago

I was able to use your testing harness to figure this out. Thanks again for the work you've done on it.