kbickar / asyncsleepiq Goto Github PK
View Code? Open in Web Editor NEWAsync interface to SleepIQ API
License: MIT License
Async interface to SleepIQ API
License: MIT License
Per home-assistant/core#90334, I think this library doesn't currently support the Climate360 Model
I have this model, and am willing to help debug! I have the library set up locally and am able to query the API with my credentials. I am doing a bit of reverse engineering (as I'm sure you've already done yourself) on what needs to be done to get this model to work!
Thanks for the foundation changes @mfugate1 Mine doesn't have/support the foundation so I find it a little difficult to test it - does yours have the lights? If so, can you test the following code at the end of the example:
print("Available lights:")
for light in bed.foundation.lights:
print(f" - {light}: {bed.foundation.lights[light]}")
print("Turning on lights...")
for light in bed.foundation.lights:
bed.foundation.set_light(light, True)
bed.foundation.fetch_light(light)
print(f" {light}: {bed.foundation.lights[light]}")
await asyncio.sleep(1)
await asyncio.sleep(10)
print("Turning off lights...")
for light in bed.foundation.lights:
bed.foundation.set_light(light, False)
bed.foundation.fetch_light(light)
print(f" {light}: {bed.foundation.lights[light]}")
await asyncio.sleep(1)
status = await bed.foundation.foundation_status()
print(f"Foundation status: {status}")
print(f"Features: {bed.foundation.features}")
If the above works, it would be good to create a new light object which could then be more easily referenced to turn on/off
I was excited about the integration with Home Assistant (as I had manually created a way to control the Foundation aspect of my SleepNumber bed inside of Home Assistant but it was clunky). And excellent work btw!
However, when I added my bed, it was missing control of the Left/Head side of our bed (number.sleepnumber_our_bed_left_head_position was missing).
So, I started digging into your API and discovered that it was only returning 3 actuators (None/Head, Right/Head, and None/Foot). It appeared that Left/Head was missing.
I am not a very good coder, but I modified the Foundation.py file:
` async def init_actuators(self, data: dict[str, Any]) -> None:
"""Initialize list of actuators available on foundation."""
self.is_moving = data["fsIsMoving"]
if self.type in ["single", "easternKing"]:
self.actuators = [
SleepIQActuator(self._api, self.bed_id, None, 0),
SleepIQActuator(self._api, self.bed_id, None, 1),
]
self.presets = [SleepIQPreset(self._api, self.bed_id, 0)]
elif self.type == "splitHead":
self.actuators = [
SleepIQActuator(self._api, self.bed_id, 0, 0),
SleepIQActuator(self._api, self.bed_id, 1, 0),
**SleepIQActuator(self._api, self.bed_id, 2, 0),**
SleepIQActuator(self._api, self.bed_id, None, 1),
]
else:
self.actuators = [
SleepIQActuator(self._api, self.bed_id, 0, 0),
SleepIQActuator(self._api, self.bed_id, 1, 0),
SleepIQActuator(self._api, self.bed_id, 0, 1),
SleepIQActuator(self._api, self.bed_id, 1, 1),
]
await self.update_actuators(data)`
Then I modified const.py to include the "None" side:
SIDES = ["None", "L", "R"] SIDES_FULL = ["None", "Left", "Right"]
This seems to have fixed it within Home Assistant (as well as my local python instance). However, I have no idea if this makes sense or all changes were required. Let me know if I can provide additional details.
Hubitat has control of the SleepIQ footwarmers in its integration. I would be willing to test a HA integration that has control of footwarmers entities.
I would like to add support for the cooling/warming functionality of the Cloud360 bed within the library to be utilized with Home Assistant.
I am willing to contribute development time and testing time if this is a feature you're willing to add to the library.
Thank you!
Hey there!
I noticed in fuzion/foot_warmer.py and foot_warmer.py that the time range is limited to 360 minutes (6 hours), but the app will allow you to set it to 600 minutes (10 hours).
if time <= 0 or time > 360:
raise ValueError("Invalid Time, must be between 0 and 360")
I am curious if that is on purpose?
Per #13 (comment), I think we need to be passing "left" or "right" in the args, as right now we're not passing any and I think that results in "FAIL:2" being returned
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.