-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
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
Extend blebox shutterbox tilt support #110547
Extend blebox shutterbox tilt support #110547
Conversation
Hey there @bbx-a, @riokuu, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Anything that needs to be done to move it forward? |
@MartinHjelmare can we have another look? It is still relevant despite it is in limbo since February. |
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 answer the review questions and add tests for the new code to tests/components/blebox/test_cover.py
BleboxCoverState.OVERLOAD: STATE_PROBLEM, | ||
BleboxCoverState.MOTOR_FAILURE: STATE_PROBLEM, |
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.
problem
is not a valid state for Home Assistant covers, have you tested this change, and it works the way you expect it to?
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 aware of that. As you have also noticed in other comment the same is for jammed state (which is closest conceptually to safety stop as it means engine has stopped because gate/shutter driver discovered obstacle).
It's a pity that neither STATE_JAMMED nor STATE_PROBLEM is in any way observed by HA covers. On the other hand, existence of this state here has no negative impact on integration.
What if we leave it here as is and let me figure out if I can make the base cover somehow observe problem/jammed state. This will be a bit more challenging to me as I need to look how such states are handled/implemented in other components. I could then submit such change as a separate PR so other integrations could benefit from it?
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 see. The end result is that the cover will in states problem and jammed get the "open" state, right? Also, this change should be moved to a separate 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.
Reverted, will submit separate PR
BleboxCoverState.OVERLOAD: STATE_PROBLEM, | ||
BleboxCoverState.MOTOR_FAILURE: STATE_PROBLEM, | ||
BleboxCoverState.UNUSED: None, # never used | ||
BleboxCoverState.SAFETY_STOP: STATE_JAMMED, |
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.
jammed
is not a valid state for Home Assistant covers, have you tested this change, and it works the way you expect it to?
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.
Reverted, no longer relevant.
self._attr_supported_features = ( | ||
position | stop | CoverEntityFeature.OPEN | CoverEntityFeature.CLOSE | ||
CoverEntityFeature.OPEN | CoverEntityFeature.CLOSE | ||
) |
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 is this changed? Is it just to make the code more readable?
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 it was meant to improve readability. I was constantly confused whether it has position and stop features.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
e54dde6
to
30d9f3c
Compare
@emontnemery answered to the questions and added missing test |
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 move all changes which are not related to the tilt support to a separate PR aimed to improved code quality.
BleboxCoverState.OVERLOAD: STATE_PROBLEM, | ||
BleboxCoverState.MOTOR_FAILURE: STATE_PROBLEM, |
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 see. The end result is that the cover will in states problem and jammed get the "open" state, right? Also, this change should be moved to a separate PR.
@swistakm Please move the unrelated changes to separate PRs so we can get this PR merged 👍 |
@emontnemery: sure! I've been swamped a little bit lately but will pick it up later this week. |
Co-authored-by: Erik Montnemery <erik@montnemery.com>
f349714
to
bc0bde6
Compare
@emontnemery: reverted all the changes to |
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, @swistakm 👍
* dev: (642 commits) Improve config flow type hints (part 4) (home-assistant#124348) Improve config flow type hints (part 1) (home-assistant#124343) Add tests for Bring integration (home-assistant#123087) Add DROP Alert product support (home-assistant#117867) update ttn_client - fix crash with SenseCAP devices (home-assistant#124370) Add Aranet Radon Plus support (home-assistant#124197) Fix Spotify Media Browsing fails for new config entries (home-assistant#124368) Convert Bang & Olufsen testing logging patches to caplog (home-assistant#124366) Remove unneeded check for Bang & Olufsen events and device update (home-assistant#124363) Bump async-interrupt to 1.2.0 (home-assistant#124360) Rename OpenThermGatewayDevice to OpenThermGatewayHub (home-assistant#124361) Fix Weatherflow Cloud lightning (home-assistant#124082) Change POWER_VOLT_AMPERE_REACTIVE to UnitOfReactivePower (home-assistant#117153) Disable Habitica deprecated entities by default (home-assistant#123522) Add test cases for ViCare entities (home-assistant#122983) Add tests for IronOS integration (home-assistant#123078) Fix state name for binary_sensor Power from clear/detected to on/off (home-assistant#116994) Extend blebox shutterbox tilt support (home-assistant#110547) blebox: use blebox_uniapi.cover.BleboxCoverState enum members instead of plain integers (home-assistant#124302) Add custom panel for LCN configuration (home-assistant#108664) ...
Proposed change
Add
CoverEntityFeature.OPEN_TILT
andCoverEntityFeature.CLOSE_TILT
toBleBoxCoverEntity
.The intermediary
blebox_uniapi
does not provide API for open/close tilt but it does have an API for setting specific tilt position. It means that open/close tilt can be achieved through set position. New API will come in futureblebox_uniapi
version so this change implements the feature in future-compatible way.This PR also improves mapping of internal switchbox cover states into homeassistant states mainly by introducing proper failure states.
Type of change
Additional information
Checklist
ruff format 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
.To help with the load of incoming pull requests: