-
Notifications
You must be signed in to change notification settings - Fork 10
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
Adding Climate and Fan Support #20
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks for these changes! Please see my review comments
@@ -37,7 +37,7 @@ async def async_setup_entry( | |||
|
|||
for item in items_of_category: | |||
try: | |||
if item["type"] == CONTROL4_ENTITY_TYPE and item["id"]: |
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.
What does this do? Why do we need to check for "fan" inside the light integration?
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.
The fan controllers get detected as lights, that's what made me tackle fan controllers. They would add a bunch of errors to my logs.
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.
Ah that makes sense, could you add a short comment in the code here just explaining that so it doesn't get accidentally removed in the future?
@@ -213,8 +213,9 @@ def __init__( | |||
) | |||
self._device_class = device_class | |||
self._extra_state_attributes["alarm_zone_id"] = alarm_zone_id | |||
self._extra_state_attributes["ContactState"] = bool( |
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.
What do these changes do? They seem unrelated to fan/climate support. Could you separate these changes out into a different PR?
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.
Yes, I have many more changes to the binary_sensor, I have found several different messages sent by different c4 binary sensors around the house. I am not good with git, but I will try!
# _LOGGER.debug( "Emergency Found: %s", | ||
# self._extra_state_attributes["HVAC_MODES_LIST"], | ||
# ) |
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.
Could you remove commented out code here and elsewhere in this PR
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.
Yes
try: | ||
if self.hvac_mode == HVACMode.HEAT_COOL: | ||
if low_temp and high_temp: | ||
if high_temp - low_temp < MIN_TEMP_RANGE: |
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.
Why do we need to enforce a MIN_TEMP_RANGE in Home Assistant? Does Control4 not enforce this on the device side?
@property | ||
def percentage_step(self) -> float: | ||
"""Return the step size for percentage.""" | ||
return 25 |
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.
Do all fans have a 25% step size?
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.
Probably not, all the control4 fan controllers I have have 4 preset modes. I will dig a little and see what more I can find out here.
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.
It would be ideal if we could determine this from the Control4 API response, if they provide that information in the device info
import logging | ||
from typing import Any | ||
|
||
from pyControl4.fan import C4Fan |
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 realized that pyControl4 doesn't currently have a fan class. Please open a PR there with the fan changes as well. We will need to merge the pyControl4 changes before this integration can be merged.
Hey @granvillebarker are you still able to work on this PR? |
Adding fan controller support.