Skip to content
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

range: add oven timers and cook timers #843

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

twilsonco
Copy link

@twilsonco twilsonco commented Dec 18, 2024

This change adds timestamp device sensors for upper/lower oven timers and cook times, and respective binary state sensors. When no timer is set, timer finish time is set to beginning of current day.

ha lg range timer

and respective state sensors.

when no timer is set, timer finish time is set to
beginning of current day
Comment on lines +165 to +175
@property
def oven_upper_cook_timer_time(self) -> datetime | None:
"""Get the upper cook time finish time."""
delta = self._get_time_delta(
"UpperCookTimeHour", "UpperCookTimeMin", "UpperCookTimeSec"
)
return self._update_feature(
RangeFeatures.OVEN_UPPER_COOK_TIMER_TIME,
self._get_finish_time(delta),
False,
)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should find a way to check if the device provide this sensor (oven_upper_cook) and if not just return None, otherwise sensor for not existing cook zone will be created.
This is the same for all the other new properties.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. My oven only has upper, so the lower cook zone sensors are non-functional. I'll make the necessary changes for this.

Also, the stove top of my oven only reports whether any of the (five) burners are on, and it uses the front-left cooktop state to report it. So should cooktop state sensors also be modified (in a separate PR) in the same way you're suggesting here?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants