# Second try at forcing awake using heating level
if (
stage != "awake"
and self.heating_level is not None
and self.heating_level < 5
):
return "awake"
The above code seems to ignore what is directly returned by the API and instead this if statement appears to make no sense in terms of its actual logic. Seems to indicate if the heating level is ever < 5 that even if the bed marks you as asleep it will instead mark you as awake. This likely works for those who wish to keep the bed > 5 when in the sleep:intial and sleep:final state, but seems like logic that can be entirely removed and if anyone needs this they can do so via a template in HA directly.
https://github.com/lukas-clarke/eight_sleep/blob/8f0aeb5d4a42f5c053b2efff1fc6a0b89fb8895a/custom_components/eight_sleep/pyEight/user.py#L245C1-L251C27
The above code seems to ignore what is directly returned by the API and instead this if statement appears to make no sense in terms of its actual logic. Seems to indicate if the heating level is ever < 5 that even if the bed marks you as asleep it will instead mark you as awake. This likely works for those who wish to keep the bed > 5 when in the sleep:intial and sleep:final state, but seems like logic that can be entirely removed and if anyone needs this they can do so via a template in HA directly.