[Fso] [Shr-Devel] [PATCH 2/2] Make blink rate for Oeventsd configurable

Lukas Maerdian luk at slyon.de
Fri Jul 4 13:02:37 CEST 2014


Thanks, applied.

I've merged your two patches and changed the default duration/On/Off to
100/1500, instead of 128/1024, as that is what it was before.

Now we're still missing a patch to update the gta04 configuration, to
set the blinking duration to hardware supported values, right?

BR,
  Lukas

On 03.07.2014 13:30 UTC+0200, Ben Deering wrote:
> Allow 2 optional parameters to oevents blink statements - durationOn and
> durationOff.  The default is the previous blink rate.
> 
> Signed-off-by: Ben Deering <ben_deering at swissmail.org>
> ---
>  framework/subsystems/oeventsd/leds_actions.py | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/framework/subsystems/oeventsd/leds_actions.py b/framework/subsystems/oeventsd/leds_actions.py
> index 77b96d1..70fca53 100644
> --- a/framework/subsystems/oeventsd/leds_actions.py
> +++ b/framework/subsystems/oeventsd/leds_actions.py
> @@ -78,7 +78,7 @@ class Led(object):
>  
>      def __blink(self):
>          logger.info("blink led %s", self)
> -        self.interface.SetBlinking(128, 2048, reply_handler=self.on_reply, error_handler=self.on_error)
> +        self.interface.SetBlinking(self.durationOn, self.durationOff, reply_handler=self.on_reply, error_handler=self.on_error)
>  
>      def turn_on(self, user):
>          self.users[user] = 'on'
> @@ -91,8 +91,10 @@ class Led(object):
>              logger.warning("try to turn off led %s before having turing it on", self)
>          self.__update()
>  
> -    def blink(self, user):
> +    def blink(self, user, durationOn, durationOff):
>          self.users[user] = 'blink'
> +        self.durationOn = durationOn
> +        self.durationOff = durationOff
>          self.__update()
>  
>      def __update(self):
> @@ -113,7 +115,7 @@ class LedAction(Action):
>      """
>      function_name = 'SetLed'
>  
> -    def __init__(self, device, action):
> +    def __init__(self, device, action, onDuration = 128, offDuration = 1024):
>          Action.__init__( self )
>          self.led = Led(device)
>          self.action = action
> @@ -124,7 +126,7 @@ class LedAction(Action):
>          if self.action == 'light':
>              self.led.turn_on(self)
>          elif self.action == 'blink':
> -            self.led.blink(self)
> +            self.led.blink(self, onDuration, offDuration)
>  
>      def untrigger(self, **kargs):
>          self.led.turn_off(self)
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.goldelico.com/pipermail/fso/attachments/20140704/d865e566/attachment.asc>


More information about the Fso mailing list