Closed vanstinator closed 5 years ago
It's also worth noting I haven't tried to actually manipulate the backend yet either. This is currently only fixes for pulling in data. There may be additional bugs or broken functionality given the scope of the backend changes.
While updating and fixing the unit tests I realized that the original way I was handling grabbing serial numbers was actually grabbing the name
for the controller and faucet. I explored a bit more and found the setup
page to be adequate for our needs. So I started piping that page to the serial_finder
function and updated the tests accordingly. The setup
page will make it easy for me to add support for multiple controllers and faucets in a future PR.
Awesome work @vanstinator !! Thanks for your contribution!!
This PR addresses https://github.com/tchellomello/raincloudy/issues/30. I wanted to run it by you to see what you think. As far as I can tell there was a big deploy sometime recently that changed a few key areas of the site that broke this library.
Firstly the ajax scripts changed. So everything in https://github.com/tchellomello/raincloudy/blob/master/raincloudy/helpers.py#L36 is no longer valid. There's no longer serial number information on the home page so I had to hit the setup page to grab the relevant data. As a plus there that page contains all the data we'd need to support multiple controllers and valves. So I'm hoping to add that feature in a future PR.
Secondly the
post
call to the status update endpoint doesn't appear to exist or work anymore. In its place the official site is polling a new endpoint with aget
request every 15 seconds or so. The response object from this endpoint seems to be plain JSON. This broke thelookup_attr
functions in the controller and faucet classes. In their place I just accessed thedict
directly and removed the dead functions.All tests have been updated and are currently passing.
@tchellomello this is ready for your review