mezz64 / pyEight

Python library to interface with the Eight Sleep API
MIT License
59 stars 15 forks source link

add support for 'temperature' endpoint #37

Open anant-singh opened 1 year ago

andrew-kennedy commented 1 year ago

@anant-singh Seems like you're working on reversing more of the API, do you have any place where you're publishing what you've found?

anant-singh commented 1 year ago

Where can I publish it? Is there a discord channel or forum?

mezz64 commented 1 year ago

@anant-singh Can you let me know how this differs from the current heating level value that is +/- 100? Looks like it might be the same thing, just at a new endpoint.

anant-singh commented 1 year ago

This allows you to directly set it for the user, without caring for the side. Also, it let's you turn off the heating/cooling which was the primary use case I needed. Btw I don't know if duration is valid anymore.

anant-singh commented 1 year ago

@mezz64 Any updates on this? I didn't want to make breaking changes to the API hence, added a separate method. But ideally, I believe this change could just go under set_heating_level . Or I could just add a function to turn the state off and remove all the other changes?

andrew-kennedy commented 1 year ago

This allows you to directly set it for the user, without caring for the side. Also, it let's you turn off the heating/cooling which was the primary use case I needed. Btw I don't know if duration is valid anymore.

Duration is valid, as I use the current version of pyEight in home automations, and it shows up as a "timer" mode in the app, though there is no way to set a duration from the app. Seems like a deprecated API. The mode you are adding in this PR is the way the app currently sets the heating and cooling mode, and it respects smart schedules.

mezz64 commented 1 year ago

I'd prefer to just have one method, especially if they've changed the app to no longer use the old way.

Best thing to do is define your new functions and then adapt the existing "set_heating_level" function to use the new functions to maintain compatability. I'll try to find some time over the next few days to run some test on my device, but please keep in mind not all eight devices out there are PODs with cooling functionality. Some offer heating only so we need to ensure bounds are respected correctly for those types of devices.