Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ This mode is split up in two types of strategies; [Presence](https://github.com/
| Variables | Default | Range | Description |
| ----------------- | ------- | ----- | ------------------------------------------------------------------------------------------- |
| Window Height | 2.1 | 0.1-6 | Length of fully extended cover/window |
| Workarea Distance | 0.5 | 0.1-2 | The distance to the workarea on equal height to the bottom of the cover when fully extended |
| Window Position | 1.0 | 0.1-6 | The vertical distance from the workarea to the base of the cover when fully extended |
| Workarea Distance | 0.5 | 0.1-2 | The horizontal distance from the workarea to the cover |

### Horizontal

Expand Down
3 changes: 2 additions & 1 deletion custom_components/adaptive_cover/calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,13 @@ class AdaptiveVerticalCover(AdaptiveGeneralCover):

distance: float
h_win: float
p_win: float

def calculate_position(self) -> float:
"""Calculate blind height."""
# calculate blind height
blind_height = np.clip(
(self.distance / cos(rad(self.gamma))) * tan(rad(self.sol_elev)),
((self.distance / cos(rad(self.gamma))) * tan(rad(self.sol_elev))) - self.p_win,
0,
self.h_win,
)
Expand Down
7 changes: 7 additions & 0 deletions custom_components/adaptive_cover/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
CONF_MIN_ELEVATION,
CONF_MODE,
CONF_OUTSIDETEMP_ENTITY,
CONF_POSITION_WIN,
CONF_PRESENCE_ENTITY,
CONF_RETURN_SUNSET,
CONF_SENSOR_TYPE,
Expand Down Expand Up @@ -168,6 +169,11 @@
min=0.1, max=6, step=0.01, mode="slider", unit_of_measurement="m"
)
),
vol.Required(CONF_POSITION_WIN, default=1.0): selector.NumberSelector(
selector.NumberSelectorConfig(
min=0, max=10, step=0.01, mode="slider", unit_of_measurement="m"
)
),
vol.Required(CONF_DISTANCE, default=0.5): selector.NumberSelector(
selector.NumberSelectorConfig(
min=0.1, max=2, step=0.1, mode="slider", unit_of_measurement="m"
Expand Down Expand Up @@ -572,6 +578,7 @@ async def async_step_update(self, user_input: dict[str, Any] | None = None):
CONF_MODE: self.mode,
CONF_AZIMUTH: self.config.get(CONF_AZIMUTH),
CONF_HEIGHT_WIN: self.config.get(CONF_HEIGHT_WIN),
CONF_POSITION_WIN: self.config.get(CONF_POSITION_WIN),
CONF_DISTANCE: self.config.get(CONF_DISTANCE),
CONF_DEFAULT_HEIGHT: self.config.get(CONF_DEFAULT_HEIGHT),
CONF_MAX_POSITION: self.config.get(CONF_MAX_POSITION),
Expand Down
1 change: 1 addition & 0 deletions custom_components/adaptive_cover/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
CONF_AZIMUTH = "set_azimuth"
CONF_BLUEPRINT = "blueprint"
CONF_HEIGHT_WIN = "window_height"
CONF_POSITION_WIN = "window_position"
CONF_DISTANCE = "distance_shaded_area"
CONF_DEFAULT_HEIGHT = "default_percentage"
CONF_FOV_LEFT = "fov_left"
Expand Down
2 changes: 2 additions & 0 deletions custom_components/adaptive_cover/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
CONF_MIN_POSITION,
CONF_OUTSIDE_THRESHOLD,
CONF_OUTSIDETEMP_ENTITY,
CONF_POSITION_WIN,
CONF_PRESENCE_ENTITY,
CONF_RETURN_SUNSET,
CONF_START_ENTITY,
Expand Down Expand Up @@ -665,6 +666,7 @@ def vertical_data(self, options):
return [
options.get(CONF_DISTANCE),
options.get(CONF_HEIGHT_WIN),
options.get(CONF_POSITION_WIN),
]

def horizontal_data(self, options):
Expand Down
2 changes: 2 additions & 0 deletions custom_components/adaptive_cover/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"data": {
"set_azimuth": "Window Azimuth",
"window_height": "Window Height",
"window_position": "Window Position",
"distance_shaded_area": "Shaded area",
"default_percentage": "Default Position",
"max_position": "Maximum Position",
Expand Down Expand Up @@ -258,6 +259,7 @@
"data": {
"set_azimuth": "Window Azimuth",
"window_height": "Window Height",
"window_position": "Window Position",
"distance_shaded_area": "Shaded area",
"default_percentage": "Default Position",
"max_position": "Maximum Position",
Expand Down
2 changes: 2 additions & 0 deletions custom_components/adaptive_cover/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"data": {
"set_azimuth": "Window Azimuth",
"window_height": "Window Height",
"window_position": "Window Position",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add a longer description of this new parameter in the "data_description" section so that it appears in the HA GUI during configuration. Then users don't have to come to GitHub and scroll through the README to figure out the meaning of this new parameter.

"distance_shaded_area": "Shaded area",
"default_percentage": "Default Position",
"min_position": "Minimum Position",
Expand Down Expand Up @@ -271,6 +272,7 @@
"data": {
"set_azimuth": "Window Azimuth",
"window_height": "Window Height",
"window_position": "Window Position",
"distance_shaded_area": "Shaded area",
"default_percentage": "Default Position",
"min_position": "Minimum Position",
Expand Down