How to properly use autostart

  • Hi,


    I'm begginer at Python and Enigma 2 programming so I ask You about forbearance.


    I try to write a sctipt which will detect (I hope) if DM is in standby mode.


    At the moment I' m on autorun stage.


    My code looks like below:


    The problem is that:


    - if I un# line aa = Lampki () during rebooting enigma hungs up (simple BitBang device works porperly),
    - if I # aa = .... line and un# f reason == 0 and kwargs.has_key("session"): and it' s body enigma reboots properly but device don't work.


    Can someone help me. As I wrote I'm begginer.


    P.S. The ideal state is if Lampki class behaves as daemon or detects standby switch event but I don't know how to do this (so maybe at the beginning infinitive while loop idea is anough).

    "Reasonable people adapt themselves to the world.
    Unreasonable people attempt to adapt the world to themselves.
    All progress, therefore, depends on unreasonable people"


    ============
    SubsDownloader

  • Yes they are (i know the python basis) the forum code don't allow to use shifting.

    "Reasonable people adapt themselves to the world.
    Unreasonable people attempt to adapt the world to themselves.
    All progress, therefore, depends on unreasonable people"


    ============
    SubsDownloader

  • Autostart is to early, no session is available there, you have to attach to sessionstart. Check schwerkraft plugin repository and there the source for plugib KiddyTimer to see, how to do that.


    To find out, wheather box goes to standby you simply add a notifier to a config variable:


    93 config.misc.standbyCounter.addNotifier(self.enterStandby, initial_call = False)


    As used in KTmain.py of Kiddytimer


    Hth
    Tode