Skip to content

Commit

Permalink
Merge pull request #31 from basbruss/dev
Browse files Browse the repository at this point in the history
Update blueprint
  • Loading branch information
basbruss authored Jan 17, 2024
2 parents 5f06190 + 223fd64 commit 45a1a49
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
27 changes: 21 additions & 6 deletions custom_components/adaptive_cover/blueprints/adaptive_cover.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
blueprint:
name: Adaptive Cover
description: "`version 0.0.1` \n
description: "`version 0.0.2` \n
Set cover position based on direct sunlight exposed to window \n\n
Calculations are done internally in the blueprint removing the need to use a sensor to input a value
\n for in depth information on the calculations and variables, check this forum [post](https://community.home-assistant.io/t/automatic-blinds-sunscreen-control-based-on-sun-platform/573818)
Expand Down Expand Up @@ -112,10 +112,25 @@ action:
- condition: time
after: "00:01:00"
before: "23:59:00"
- service: cover.set_cover_position
data:
position: "{{states(adaptive_cover_entity)}}"
target:
entity_id: "{{entities}}"
- repeat:
sequence:
- if:
- condition: template
value_template: "{{state_attr(repeat.item,'cover_type')=='cover_tilt'}}"
then:
- service: cover.set_cover_tilt_position
metadata: {}
data:
position: "{{states(adaptive_cover_entity)}}"
target:
entity_id: "{{repeat.item}}"
else:
- service: cover.set_cover_position
metadata: {}
data:
position: "{{states(adaptive_cover_entity)}}"
target:
entity_id: "{{repeat.item}}"
for_each: "{{entities}}"
- choose: []
default: !input action
1 change: 1 addition & 0 deletions custom_components/adaptive_cover/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def extra_state_attributes(self) -> Mapping[str, Any] | None: # noqa: D102
'start_time': self._cover_data.start,
'end_time': self._cover_data.end,
"entity_id": self.config_entry.options[CONF_ENTITIES],
"cover_type": self._cover_type,
# "test": self.config_entry,
}
if self._cover_type == "cover_blind":
Expand Down

0 comments on commit 45a1a49

Please sign in to comment.