Skip to content

Commit

Permalink
Enable setting volume to 0 or 1 with large rotation angles
Browse files Browse the repository at this point in the history
When the rotation angle is too large, the target volume was <0 or >1 and not set at all. By manually setting it to 0 or 1, the volume is set correctly.
  • Loading branch information
zi4k4j74yn committed Jan 4, 2024
1 parent 241faf3 commit 4b79f0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Scripts/volume_control_4_magic_cube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ sequence:
data_template:
volume_level: >-
{% set v = state_attr(mp, 'volume_level') | float(0.4) %}
{{ v + 0.0000625 * delta }}
{{ min(max(0, v + 0.0000625 * delta), 1) }}
target:
entity_id: "{{ mp }}"

Expand Down

0 comments on commit 4b79f0f

Please sign in to comment.