Skip to content

Commit

Permalink
Fix #100. Provide operation state as extra attribute, but don't inter…
Browse files Browse the repository at this point in the history
…pret opening / closing.

Bumped to boschshcpy==0.2.104
  • Loading branch information
tschamm committed Jan 12, 2025
1 parent d9cd4ef commit 8731fb4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
23 changes: 7 additions & 16 deletions custom_components/bosch_shc/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,6 @@ def is_closed(self):
"""Return if the cover is closed or not."""
return self.current_cover_position == 0

@property
def is_opening(self):
"""Return if the cover is opening or not."""
return (
self._device.operation_state
== SHCShutterControl.ShutterControlService.State.OPENING
)

@property
def is_closing(self):
"""Return if the cover is closing or not."""
return (
self._device.operation_state
== SHCShutterControl.ShutterControlService.State.CLOSING
)

def open_cover(self, **kwargs):
"""Open the cover."""
self._device.level = 1.0
Expand All @@ -120,6 +104,13 @@ def set_cover_position(self, **kwargs):
position = kwargs[ATTR_POSITION]
self._device.level = position / 100.0

@property
def extra_state_attributes(self):
"""Return the state attributes."""
return {
"operation_state": self._device.operation_state,
}


class BlindsControlCover(ShutterControlCover, CoverEntity):
"""Representation of a SHC blinds cover device."""
Expand Down
4 changes: 2 additions & 2 deletions custom_components/bosch_shc/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"documentation": "https://github.com/tschamm/boschshc-hass/blob/master/README.md",
"iot_class": "local_push",
"issue_tracker": "https://github.com/tschamm/boschshc-hass/issues",
"requirements": ["boschshcpy==0.2.103"],
"version": "0.4.96-dev5",
"requirements": ["boschshcpy==0.2.104"],
"version": "0.4.96-dev6",
"zeroconf": [{ "type": "_http._tcp.local.", "name": "bosch shc*" }]
}

0 comments on commit 8731fb4

Please sign in to comment.