ZHA cover device support#30639
Conversation
|
Hi @billyburly, It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
|
Hey there @dmulcahey, @Adminiuga, mind taking a look at this pull request as its been labeled with a integration ( |
Adminiuga
left a comment
There was a problem hiding this comment.
Call cluster commands as methods of the channel.
|
@Adminiuga added a check to see if the commands were successful |
|
Hrm, I have no ideas why codecov fails. |
Adminiuga
left a comment
There was a problem hiding this comment.
@dmulcahey this looks fine to me. But wouldn't mind a second set of eyes.
|
Awesome, I’ll peek at this in detail in the morning. |
|
I think if you cover a couple more lines like in here https://codecov.io/gh/home-assistant/home-assistant/compare/d25aa1f1830f1d3fad42dde3f9bdfae2ad98b7f2...0567474b9473e0c06ee40a3323aae41d54b1d5f1/diff#D4-92 it should pass the coverage test. |
|
and check https://github.com/home-assistant/home-assistant/blob/74a198e37b9fc3d189d307cc5396609513d9e0e6/tests/components/zha/test_sensor.py#L86 something similar should cover line 38 of |
|
install pre-commit . saves some time ;) |
@billyburly You need to add a test to cover the uncovered branch in |
|
This looks good to me. Thanks for the contribution! This can be merged after the coverage check passes. |
|
@billyburly wanna give billyburly#1 a try? I still don't fully understand, why with The mock gets called two times, but return 100 only the 1st time, so |
Update ZHA cover tests coverage.
|
Thank you! |
|
@Adminiuga thanks for the help with the test |
MartinHjelmare
left a comment
There was a problem hiding this comment.
Some suggestions for the future.
| """Open the window cover.""" | ||
| res = await self._cover_channel.up_open() | ||
| if isinstance(res, list) and res[1] is Status.SUCCESS: | ||
| self.async_set_state(STATE_OPENING) |
There was a problem hiding this comment.
With this info we can implement is_opening cover entity property.
| """Close the window cover.""" | ||
| res = await self._cover_channel.down_close() | ||
| if isinstance(res, list) and res[1] is Status.SUCCESS: | ||
| self.async_set_state(STATE_CLOSING) |
There was a problem hiding this comment.
With this info we can implement is_closing cover entity property.
| """Stop the window cover.""" | ||
| res = await self._cover_channel.stop() | ||
| if isinstance(res, list) and res[1] is Status.SUCCESS: | ||
| self._state = STATE_OPEN if self._current_position > 0 else STATE_CLOSED |
|
|
||
| async def async_set_cover_position(self, **kwargs): | ||
| """Move the roller shutter to a specific position.""" | ||
| new_pos = kwargs.get(ATTR_POSITION) |
There was a problem hiding this comment.
Position is required.
new_pos = kwargs[ATTR_POSITION]
Description:
Support for ZHA cover devices. Allows control of IKEA Fyrtur blinds via the zha integration
Related issue (if applicable): fixes #
Pull request with documentation for home-assistant.io : home-assistant/home-assistant.io#11695
Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed: