Closed traviswparker closed 2 years ago
That’s interesting. I have two beds - one with a foundation and one without. My bed without a foundation configured correctly. I know the foundation API is kind of weird across different bed versions though. What model of bed do you have and roughly when did you buy it?
Regardless, I will add better checks at that part of the setup to make sure it works properly.
Can you tell me what the API request does return in your case?
You wouldn’t see if if your beds were cached before 1.2.0 as it occurs during new device setup. I reset HB to clean up unrelated stuff and ran into this bug. I can dig into API responses tomorrow.
Okay thanks, I will see if I can reproduce it as well.
From what I've seen in other projects, if no foundation it should be a 404.
Is your feature request related to a problem? Please describe:
snapi.getFoundationStatus does not return undefined if foundationStatus request fails, which causes bed setup in platform.ts to not throw an exception and set foundation to true. This adds useless controls to Home and throws errors in the HB logs.
Describe the solution you'd like:
removing the if (res !== undefined) { condition that was added to snapi.foundationStatus in 1.2.0 fixes it for now, but you can check the base: value in the bedStatus result for the foundation. It will be non-null if a foundation is present.
Describe alternatives you've considered:
Additional context: