Habapp sundown

i nearly transfered most of my rules to HabApp now. And I loved it. Python is much easier for me than javascript.
I have a sunset job in the old way .
This I want now to realsize with the scheduler.
I already use scheduler jobs on habapp that runs every x minutes or only on special days.
Now my question:

I want to have a sunset job that runs on sunset, but not before a special time.
If I look in the class reference for the Scheduler I found a class SunSetJob
with a Method earliest().
That was the one I cann use to set the earliest Time.

But how can I use/set this in the habapp pythons Script.
In the HabAppSchedulerView I have a method (on_sundown()) that returns
a SunSetJob as the returnValue.

But with this I’m not able to set or call the earliest.
I did something like
But after that i have no sel.mysunset.earliest()

Any hints what I’m doing wrong?

Sorry for the bad format, but sitting in the train, only with the smartphone isn’t easy
to format code snippets.

There is an “f” missing in self.


No that could not be the Reason.
I just entered it only in handy, not copy it from my pycharm code.
I think so.

I check it on the evening when I’m back at home

Please post the snipped and the corresponding error message in the HABApp.log

I found the solution.
It was my virtual environment on my development machine.
Yesterday evening I updated to latest habapp version.
After thatni tried to implement the scheduler with the Sunset job.
As this was not workings,I use my hourly schedule, this was working.
In this status I stopped the work.

Today ,after work, I had the same issue. But also other rules did not work anymore. In contrast to yesterday evening.

I did delete my virtual environment. Create it new, install habapp, and everything is working.
Also pycharm knows now the earlier method.

So, on some reason my venv was not function correctly after update.