-
-
Notifications
You must be signed in to change notification settings - Fork 36.2k
Add Rachio Schedules #33421
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 Rachio Schedules #33421
Conversation
|
Sounds good |
|
@brg468 This should be ready for rebase. |
This reverts commit cc8a2a3.
|
@bdraco That took me way longer than it should have but I think its finally ready.. I just noticed @MartinHjelmare's comments and noticed at least 1 applies to this. Is it easier if I fix that now? |
Probably best for me to do it in a followup so we don't expand the scope anymore and can get this one merged |
bdraco
left a comment
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.
Looks like just the missing async_will_remove_from_hass and the __str__ removal left.
|
@brg468 I tried this with 6 different systems. The schedule appears for some but not others. I'm looking into it now |
Just to make sure we're on the same page, these are fixed schedules that aren't showing up, not flex schedules correct? |
Just looked at the raw data, they are |
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.
LGTM, Just needs the docs updated and this should be good to go.
I never tried it before because looking at the dependency I assumed it wouldn't work, but you can actually trigger a flex schedule in the same manner. That can be a project for another day.. |
Nice, new PR for sure though to keep scope reasonable |
| _LOGGER.debug("Rachio setting up zone: %s", zone) | ||
| entities.append(RachioZone(person, controller, zone, current_schedule)) | ||
| for sched in schedules: | ||
| _LOGGER.debug("Added schedule: %s", sched) |
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.
If it's still enough info, it would save on the logging calls if we just logged the list with added entities once. The entity has a repr magic method and will print the name and current state.
| self._undo_dispatcher = None | ||
|
|
||
| @property | ||
| def schedule_id(self) -> str: |
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.
Generally we don't need to define properties if we just return the instance attribute. We could instead just make the instance attribute public and name it appropriately.
| self._current_schedule = self._controller.current_schedule | ||
| return self.schedule_id == self._current_schedule.get(KEY_SCHEDULE_ID) | ||
|
|
||
| def _handle_update(self, *args, **kwargs) -> None: |
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.
Does this need to run in the executor thread pool? If not, we should decorate it with @callback imported from core.py and prefix the name with async_.
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.
I'm planning to add another PR that allows all schedules to be used instead of just fixed schedules. I'll address these changes in that PR.
Proposed change
This PR adds Rachio fixed schedules as switches. This allows an entire schedule to be started or stopped from HomeAssistant, instead of only individual zones for a pre-determined amount of time.
This is my first PR so go easy on me!
Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale: