Replies: 1 comment
-
|
At first sight, it should work. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is not a specific question about
pyscriptbut rather its use and a request for fresh eyes on a very simple piece of code.I wanted to write automation that pulls up window covers when someone leaves. It is part of several other automation that works great. (explanation of the code below the block)
The idea is that when
person.martinswitches tonot_homesome covers get pulled up (viacover.open_cover(entity_id="cover.martin_volets")). Since I want to do it only once, the first timemartinleaves, I use a flag (pyscript.martin_one_time_volets_up) that gets reset every night at 04:00. If the covers are pulled up automatically once, they will not do so another time in one day (I will improve that later).The problem: I never get into the
ifcondition. When forcefully switchingperson.martintonot_home, I get the following in the logs:This means that
pyscript.martin_one_time_volets_upisFalse(good! → this is the first time today the script is triggered)person.martinisnot_home(good! → just a double check but the trigger already tells us so)And yet
if not pyscript.martin_one_time_volets_up:is not stepped into (no logs, and no covers up either)This must be something horribly obvious, I apologize in advance if so, but I am looking at this simple code and am stuck.
Beta Was this translation helpful? Give feedback.
All reactions