Skip to content

Commit

Permalink
Merge branch 'main' into elevation_options
Browse files Browse the repository at this point in the history
  • Loading branch information
basbruss committed May 23, 2024
2 parents 74119df + 2e78d22 commit a3a92be
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/hacs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected].5
uses: actions/[email protected].6

- name: 🚀 Run HACS validation
uses: hacs/action@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hassfest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/[email protected].5"
uses: "actions/[email protected].6"

- name: "Run hassfest validation"
uses: "home-assistant/actions/hassfest@master"
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
id-token: write
steps:
- name: "Checkout the repository"
uses: "actions/[email protected].5"
uses: "actions/[email protected].6"

- name: 🔢 Adjust version number
shell: bash
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 @@ -34,6 +34,7 @@ class AdaptiveGeneralCover(ABC):
blind_spot_left: int
blind_spot_right: int
blind_spot_elevation: int
blind_spot_on: bool
min_elevation: int
max_elevation: int
sun_data: SunData = field(init=False)
Expand Down Expand Up @@ -74,7 +75,7 @@ def _get_azimuth_edges(self) -> tuple[int,int]:
@property
def is_sun_in_blind_spot(self) -> bool:
"""Check if sun is in blind spot."""
if self.blind_spot_left is not None and self.blind_spot_right is not None:
if self.blind_spot_left is not None and self.blind_spot_right is not None and self.blind_spot_on:
left_edge = self.fov_left - self.blind_spot_left
right_edge = self.fov_left - self.blind_spot_right
blindspot = (self.gamma <= left_edge) & (self.gamma >= right_edge)
Expand Down
3 changes: 1 addition & 2 deletions custom_components/adaptive_cover/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
selector.NumberSelectorConfig(
min=1, max=100, step=1, mode="slider", unit_of_measurement="%"
)

),
vol.Optional(CONF_MIN_ELEVATION): vol.All(vol.Coerce(int), vol.Range(min=0, max=90)),
vol.Optional(CONF_MAX_ELEVATION): vol.All(vol.Coerce(int), vol.Range(min=0, max=90)),
Expand Down Expand Up @@ -317,8 +318,6 @@ def async_get_options_flow(config_entry):
"""Get the options flow for this handler."""
return OptionsFlowHandler(config_entry)



async def async_step_user(self, user_input: dict[str, Any] | None = None):
"""Handle the initial step."""
# errors = {}
Expand Down
3 changes: 3 additions & 0 deletions custom_components/adaptive_cover/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
CONF_DELTA_POSITION,
CONF_DELTA_TIME,
CONF_DISTANCE,
CONF_ENABLE_BLIND_SPOT,
CONF_END_ENTITY,
CONF_END_TIME,
CONF_ENTITIES,
Expand Down Expand Up @@ -284,6 +285,7 @@ async def _async_update_data(self) -> AdaptiveCoverData:
self.config_entry.options.get(CONF_FOV_LEFT),
self.config_entry.options.get(CONF_FOV_RIGHT),
],
"blind_spot": self.config_entry.options.get(CONF_BLIND_SPOT_ELEVATION),
},
)

Expand Down Expand Up @@ -417,6 +419,7 @@ def common_data(self):
self.config_entry.options.get(CONF_BLIND_SPOT_LEFT),
self.config_entry.options.get(CONF_BLIND_SPOT_RIGHT),
self.config_entry.options.get(CONF_BLIND_SPOT_ELEVATION),
self.config_entry.options.get(CONF_ENABLE_BLIND_SPOT, False),
self.config_entry.options.get(CONF_MIN_ELEVATION, None),
self.config_entry.options.get(CONF_MAX_ELEVATION, None),
]
Expand Down
3 changes: 2 additions & 1 deletion custom_components/adaptive_cover/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@
"automation": "Modify Automation Configuration",
"blind": "Fine-tune Blind Settings",
"climate": "Edit Climate Configuration",
"weather": "Edit Weather Configuration"
"weather": "Edit Weather Configuration",
"blind_spot": "Setup Blindspot"
}
},
"automation": {
Expand Down
16 changes: 8 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ python = "^3.11"
hass-nabucasa = "0.75.1"
pre-commit = "3.7.1"
pre-commit-hooks = "4.6.0"
pylint = "3.1.1"
pylint = "3.2.2"
ruff = "0.4.4"

[tool.poetry.urls]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
colorlog==6.8.2
homeassistant==2024.5.0
pip>=21.0,<24.1
ruff==0.3.5
ruff==0.4.4

0 comments on commit a3a92be

Please sign in to comment.