New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Sleepiq services #30722
Add Sleepiq services #30722
Conversation
This comment has been minimized.
This comment has been minimized.
d59783a
to
a59f167
Compare
f8bb6f7
to
2f1f273
Compare
2f1f273
to
35936b7
Compare
Added services "set_sleep_number" and "set_to_favorite_sleep_number" to the SleepIQ component. This allows for automation of Sleep Number bed controls.
35936b7
to
f63a56d
Compare
Thank you for your contribution thus far! 🎖 Since this is a significant contribution, we would appreciate you'd added yourself to the list of code owners for this integration. ❤️ Please, add your GitHub username to the For more information about "code owners", see: Architecture Decision Record 0008: Code owners. Please, update the documentation and open a PR for it (be sure to create a documentation PR against the 🏷 I am adding the |
@frenck Documentation added -- PR home-assistant/home-assistant.io#11735. |
I've been meaning to add these changes for a long while now.. good thing I looked at open PRs! Thanks @Jay2645 bump |
@technicalpickles It looks like you did the original PR. #2949 Can you take a look at this? |
@bdraco I don't think I'll have any helpful feedback, as it's been quite awhile since I've done any HA development, and I'm not using the sleepiq component 😓 Let me know if you want/need commit/release access to the sleepyq library. |
@technicalpickles Thanks for getting back to us on this! I think it would be best to add @Jay2645 and @robert-alfaro to the repo as I'm just doing the code review here. |
@Jay2645 How about using entity service on the This would make the change much smaller. |
|
||
DATA.set_to_favorite_sleep_number(bed, side) | ||
|
||
hass.services.register(DOMAIN, SERVICE_SET_SLEEP_NUMBER, handle_set_number) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please create service voluptuous schemas that validates the service data and pass the schema when registering the service. See other integrations for examples.
if 0 < sleep_number <= 100: | ||
self._set_sleep_number(bed_name, side, int(sleep_number)) | ||
else: | ||
message = f"Invalid sleep number: {sleep_number}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't format the message before passing it to the logger. Use old style string formatting in combination with the logger to avoid not needed formatting if the logging isn't activated.
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
Changes `if len(side) == 0` to `if not side` Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Change `if len(bed_name) == 0` to `if not bed_name` Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
The last response from author is from January, closing this PR as stale. Feel free to re-open when ready to work on this again. 👍 |
Description:
Added services "set_sleep_number" and "set_to_favorite_sleep_number" to the SleepIQ component. This allows for changing the sleep number of a Sleep Number bed via automations.
No other changes have been made.
Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#11735
Checklist:
tox
. Your PR cannot be merged unless tests passIf the code communicates with devices, web services, or third-party tools:
python3 -m script.hassfest
.requirements_all.txt
by runningpython3 -m script.gen_requirements_all
..coveragerc
.