Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Shutter status is not displayed correctly #20

Closed
Lu6413 opened this issue Nov 13, 2022 · 6 comments
Closed

Shutter status is not displayed correctly #20

Lu6413 opened this issue Nov 13, 2022 · 6 comments
Labels

Comments

@Lu6413
Copy link

Lu6413 commented Nov 13, 2022

In cover.py the following line should be corrected:
@Property
def is_closed(self):
"""Return the state of the cover."""
return True if self.attribute(AttributeType.POSITION) == 100 else False

@FreshlyBrewedCode
Copy link
Owner

There is no way for me to verify this. Do you have multiple devices where the state is displayed incorrectly? Or do you know if this attribute is documented anywhere?

Maybe @Stklingner could also confirm if this is an error that needs to be corrected (because he implemented the cover component).

@property
def is_closed(self):
"""Return the state of the cover."""
return True if self.attribute(AttributeType.POSITION) == 1 else False

@Lu6413
Copy link
Author

Lu6413 commented Nov 14, 2022

All my shutters have always shown the status 'opened' regardless of the position. I cannot provide concrete documentation. In the forums as well as in my position attribute the value range is between 0=open and 100=closed.
The code lines
@Property
def current_cover_position(self):
"""Return the cover's position"""
return 100 - self.attribute(AttributeType.POSITION)
and my customization confirms my assumption.
This changes the status to closed as soon as the position 100 is reached.

@FreshlyBrewedCode
Copy link
Owner

Ok, thanks for the explanation. I will push a fix with your suggestion. If there are still problems in the future we can reopen this issue.

@github-actions
Copy link

🎉 This issue has been resolved in version 2.0.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@Lu6413
Copy link
Author

Lu6413 commented Nov 14, 2022

homee integration updated. Works - thank you

@Stklingner
Copy link
Contributor

Sorry for the late reply guys, good job - I'll have a look as well (mine work fine but I use my own dev branch currently)

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

No branches or pull requests

3 participants