Files
loustique-home/venv/lib/python3.11/site-packages/gpiozero/__pycache__/mixins.cpython-311.pyc

261 lines
30 KiB
Plaintext
Raw Normal View History

2026-03-21 10:53:02 +01:00
<EFBFBD>
?<3F><>i<EFBFBD>Q<00><00>T<00>ddlZddlZddlZddlmZmZddlmZddlm Z ddl
m Z ddl m Z ddlmZmZmZmZmZd ZGd
<EFBFBD>d <0B><00>ZGd <0C>d <0A><00>ZGd<0E>d<0F><00>ZGd<10>d<11><00>ZGd<12>d<13><00>ZGd<14>de<19><00>ZGd<16>de <0A><00>ZGd<18>de <0A><00>ZdS)<1A>N)<02>wraps<70>partial)<01>Event)<01>deque)<01>median<61>)<01>
GPIOThread)<05>BadEventHandler<65> BadWaitTime<6D> BadQueueLen<65> DeviceClosed<65>CallbackSetToNonez<65>The callback was set to None. This may have been unintentional e.g. btn.when_pressed = pressed() instead of btn.when_pressed = pressedc<00>(<00>eZdZdZed<02><00><00>ZdS)<04> ValuesMixinaB
Adds a :attr:`values` property to the class which returns an infinite
generator of readings from the :attr:`~Device.value` property. There is
rarely a need to use this mixin directly as all base classes in GPIO Zero
include it.
.. note::
Use this mixin *first* in the parent class list.
c#<00>BK<00> |jV<00>n#t$rYdSwxYw<01>)zI
An infinite iterator of values read from :attr:`value`.
TN)<02>valuer <00><01>selfs <20>[/home/maxime/Documents/loustiques-home/venv/lib/python3.11/site-packages/gpiozero/mixins.py<70>valueszValuesMixin.values/sH<00><00><00><00>
 <16> <16><1A>j<EFBFBD> <20> <20> <20> <20><><1F> <16> <16> <16><15><05><05> <16><><EFBFBD><EFBFBD> s <00> <00>
<03>N)<06>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__<5F>propertyr<00><00>rrr#s9<00><00><00><00><00><00> <08> <08><0E><16><16><0E>X<EFBFBD><16><16>rrc<00><><00><00>eZdZdZ<03>fd<02>Z<04>fd<03>Zd<04>Zed<05><00><00>Zej d<06><00><00>Zed<07><00><00>Z
e
j d<08><00><00>Z
<EFBFBD>xZ S) <09> SourceMixina<6E>
Adds a :attr:`source` property to the class which, given an iterable or a
:class:`ValuesMixin` descendent, sets :attr:`~Device.value` to each member
of that iterable until it is exhausted. This mixin is generally included in
novel output devices to allow their state to be driven from another device.
.. note::
Use this mixin *first* in the parent class list.
c<00>d<00><01>d|_d|_d|_t<00><00>j|i|<02><01>dS)Ng{<14>G<EFBFBD>z<EFBFBD>?)<05>_source<63>_source_thread<61> _source_delay<61>super<65>__init__<5F>r<00>args<67>kwargs<67> __class__s <20>rr%zSourceMixin.__init__Gs<<00><><00><1B><04> <0C>"<22><04><1B>!<21><04><1A><18><05><07><07><18>$<24>)<29>&<26>)<29>)<29>)<29>)<29>)rc<00>V<00><01>d|_t<00><00><00><00><00>dS<00>N)<03>sourcer$<00>close<73>rr)s <20>rr-zSourceMixin.closeMs<00><><00><1A><04> <0B> <0A><07><07> <0A> <0A><0F><0F><0F><0F>rc<00>l<00>|D]0}||_|jj<00>|j<00><00>rdS<00>1dSr+)rr"<00>stopping<6E>waitr#)rr,<00>vs r<00> _copy_valueszSourceMixin._copy_valuesQsM<00><00><17> <16> <16>A<EFBFBD><1A>D<EFBFBD>J<EFBFBD><13>"<22>+<2B>0<>0<><14>1C<31>D<>D<> <16><15><05><05> <16> <16> rc<00><00>|jS)z<>
The delay (measured in seconds) in the loop used to read values from
:attr:`source`. Defaults to 0.01 seconds which is generally sufficient
to keep CPU usage to a minimum while providing adequate responsiveness.
)r#rs r<00> source_delayzSourceMixin.source_delayWs <00><00><14>!<21>!rc<00>X<00>|dkrtd<02><00><00>t|<01><00>|_dS)Nrz!source_delay must be 0 or greater)r <00>floatr#<00>rrs rr5zSourceMixin.source_delay`s.<00><00> <10>1<EFBFBD>9<EFBFBD>9<EFBFBD><1D>A<>B<>B<> B<>"<22>5<EFBFBD>\<5C>\<5C><04><1A><1A>rc<00><00>|jS)zN
The iterable to use as a source of values for :attr:`value`.
)r!rs rr,zSourceMixin.sourcefs <00><00>
<14>|<7C>rc<00><00>t|dd<00><00>r|j<00><00><00>d|_t|t<00><00>r|j}||_|<01>6t|j|f<01><00>|_|j<00> <00><00>dSdS)Nr")
<EFBFBD>getattrr"<00>stop<6F>
isinstancerrr!r r3<00>startr8s rr,zSourceMixin.sourcems<><00><00> <12>4<EFBFBD>)<29>4<EFBFBD> 0<> 0<> '<27> <10> <1F> $<24> $<24> &<26> &<26> &<26>"<22><04><1B> <15>e<EFBFBD>[<5B> )<29> )<29> !<21><19>L<EFBFBD>E<EFBFBD><1C><04> <0C> <10> <1C>",<2C>T<EFBFBD>-><3E><15><08>"I<>"I<>D<EFBFBD> <1F> <10> <1F> %<25> %<25> '<27> '<27> '<27> '<27> '<27> <1D> r) rrrrr%r-r3rr5<00>setterr,<00> __classcell__<5F>r)s@rrr;s<><00><><00><00><00><00><00> <08> <08>*<2A>*<2A>*<2A>*<2A>*<2A> <18><18><18><18><18><16><16><16> <0E>"<22>"<22><0E>X<EFBFBD>"<22><12><18>*<2A>*<2A><19><18>*<2A>
<0E><1C><1C><0E>X<EFBFBD><1C>  <0C>]<5D> (<28> (<28><13>]<5D> (<28> (<28> (<28> (<28> (rrc<00><<00><00>eZdZdZiZ<04>fd<02>Zed<03><00><00>Z<07>xZS)<04> SharedMixina^
This mixin marks a class as "shared". In this case, the meta-class
(GPIOMeta) will use :meth:`_shared_key` to convert the constructor
arguments to an immutable key, and will check whether any existing
instances match that key. If they do, they will be returned by the
constructor instead of a new instance. An internal reference counter is
used to determine how many times an instance has been "constructed" in this
way.
When :meth:`~Device.close` is called, an internal reference counter will be
decremented and the instance will only close when it reaches zero.
c<00>V<00><01>d|_t<00><00><00><00><00>dS)Nr)<03>_refsr$<00>__del__r.s <20>rrFzSharedMixin.__del__<5F>s$<00><><00><16><04>
<EFBFBD> <0A><07><07><0F><0F><19><19><19><19>rc<00><00>t<00>)a
This is called with the constructor arguments to generate a unique
key (which must be storable in a :class:`dict` and, thus, immutable
and hashable) representing the instance that can be shared. This must
be overridden by descendents.
)<01>NotImplementedError)<03>clsr'r(s r<00> _shared_keyzSharedMixin._shared_key<65>s
<00><00>"<22>!r) rrrr<00>
_instancesrF<00> classmethodrJr@rAs@rrCrCzsd<00><><00><00><00><00><00> <08> <08><14>J<EFBFBD><1A><1A><1A><1A><1A><11>"<22>"<22><11>[<5B>"<22>"<22>"<22>"<22>"rrCc<00>.<00>eZdZdZdd<03>Zd<04>Zdd<05>Zd<06>ZdS)<08>eventa?
A descriptor representing a callable event on a class descending from
:class:`EventsMixin`.
Instances of this class are very similar to a :class:`property` but also
deal with notifying the owning class when events are assigned (or
unassigned) and wrapping callbacks implicitly as appropriate.
Nc<00>"<00>i|_||_dSr+)<02>handlersr)r<00>docs rr%zevent.__init__<5F>s<00><00><1A><04> <0A><1A><04> <0C> <0C> rc<00><><00><01><02>t<00><02><00>std<01><00><00>d}<03>}t|t<00><00>r&|j|z}|j}t|t<00><00><00>&t j|<04><00>r<02>S t j|g|<03>R<00><00>S#t$rT t j|g|<03>fz<00>R<00>t<00><02><00><00><02>fd<03><08><00>}|cYS#t$rtd<04><00><00>wxYwwxYw)Nz value must be None or a callablerc<00><00><02><00><00><01><00>Sr+r)<02>fn<66>instances<00><>r<00>wrapperz%event._wrap_callback.<locals>.wrapper<65>s<00><><00>!<21>r<EFBFBD>(<28>|<7C>|<7C>+rzDvalue must be a callable which accepts up to one mandatory parameter) <0B>callabler
r=rr'<00>func<6E>inspect<63> isbuiltin<69> getcallargs<67> TypeErrorr)rrUrTr'<00>
wrapped_fnrVs `` r<00>_wrap_callbackzevent._wrap_callback<63>sQ<00><><EFBFBD><00><17><02>|<7C>|<7C> F<01>!<21>"D<>E<>E<> E<>
<12><04><17>
<EFBFBD><18><1A>W<EFBFBD>-<2D>-<2D> )<29><1D>?<3F>T<EFBFBD>)<29>D<EFBFBD>#<23><1F>J<EFBFBD><19><1A>W<EFBFBD>-<2D>-<2D> )<29> <13> <1C>Z<EFBFBD> (<28> (<28> /<2F> <16>I<EFBFBD>
 /<2F><17>#<23>J<EFBFBD>6<><14>6<>6<>6<>6<><19> <09><><1C> /<2F> /<2F> /<2F> /<2F><1C>'<27>
<EFBFBD>J<>d<EFBFBD>h<EFBFBD>[<5B>6H<36>J<>J<>J<>J<><1A>2<EFBFBD>Y<EFBFBD>Y<EFBFBD>,<2C>,<2C>,<2C>,<2C>,<2C><1F>Y<EFBFBD>,<2C>"<22>N<EFBFBD>N<EFBFBD>N<EFBFBD><4E> <20>/<2F>/<2F>/<2F>)<29>.<2E>/<2F>/<2F>/<2F>/<2F><><EFBFBD><EFBFBD> /<2F><><EFBFBD>s$<00>7B <00>
C)<03>2C <02>C)<03> C%<05>%C)c<00>X<00>|<01>|S|j<00>t|<01><00><00><00>Sr+)rP<00>get<65>id)rrU<00>owners r<00>__get__z event.__get__<5F>s)<00><00> <13> <1B><17>K<EFBFBD><17>=<3D>$<24>$<24>R<EFBFBD><08>\<5C>\<5C>2<>2<> 2rc<00><><00><01>|<02>M |jt<00><01><00>=na#t$r)tjt t <00><00><00><00>Yn/wxYw|<00><00>|<02><00>|jt<00><01><00><t<00>fd<01>tt<00><01><00><00><00>D<00><00><00><00>}<03><01> |<03><00>dS)Nc3<00><><00>K<00>|]]}tt<00><03><00>|<01><00>}t|t<00><00><00>4|j<00>t <00><03><00><00><00>V<00><00>^dSr+)r;<00>typer=rNrPr`ra)<04>.0<EFBFBD>name<6D>objrUs <20>r<00> <genexpr>z event.__set__.<locals>.<genexpr><3E>sr<00><><00><00><00>
<EFBFBD>
<EFBFBD><14><1F><04>X<EFBFBD><0E><0E><04>5<>5<><03><19>#<23>u<EFBFBD>%<25>%<25> 
<EFBFBD> <0F>L<EFBFBD> <1C> <1C>R<EFBFBD><08>\<5C>\<5C> *<2A> *<2A>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r) rPra<00>KeyError<6F>warnings<67>warnr<00>callback_warningr^<00>any<6E>dirrf<00>_start_stop_events)rrUr<00>enableds ` r<00>__set__z event.__set__<5F>s<><00><><00> <10>=<3D> C<01><18>M<EFBFBD>"<22>X<EFBFBD>,<2C>,<2C>/<2F>/<2F><><1B> C<01> C<01> C<01><18> <0A>/<2F>0@<40>A<>A<>B<>B<>B<>B<>B<> C<01><><EFBFBD><EFBFBD>+/<2F>*=<3D>*=<3D>h<EFBFBD><05>*N<>*N<>D<EFBFBD>M<EFBFBD>"<22>X<EFBFBD>,<2C>,<2C> '<27><15>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD><1B>D<EFBFBD><18>N<EFBFBD>N<EFBFBD>+<2B>+<2B>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD><07> <11>#<23>#<23>G<EFBFBD>,<2C>,<2C>,<2C>,<2C>,s<00><00>0A<03> Ar+)rrrrr%r^rcrsrrrrNrN<00>se<00><00><00><00><00><00><08><08><1B><1B><1B><1B>&/<2F>&/<2F>&/<2F>P3<>3<>3<>3<> -<2D>-<2D>-<2D>-<2D>-rrNc<00><><00><00>eZdZdZ<03>fd<02>Zd<03>Z<05>fd<04>Zdd<06>Zdd<07>Ze d<08><00>Z
e d <09><00>Z e d
<EFBFBD><00><00>Z e d <0B><00><00>Zd <0C>Zd <0A>Zd<0E>Zd<0F>Z<12>xZS)<11> EventsMixina@
Adds edge-detected :meth:`when_activated` and :meth:`when_deactivated`
events to a device based on changes to the :attr:`~Device.is_active`
property common to all devices. Also adds :meth:`wait_for_active` and
:meth:`wait_for_inactive` methods for level-waiting.
.. note::
Note that this mixin provides no means of actually firing its events;
call :meth:`_fire_events` in sub-classes when device state changes to
trigger the events. This should also be called once at the end of
initialization to set initial states.
c<00><><00><01>t<00><00>j|i|<02><01>t<00><00>|_t<00><00>|_d|_|j<00><00><00>|_dSr+) r$r%r<00> _active_event<6E>_inactive_event<6E> _last_active<76> pin_factory<72>ticks<6B> _last_changedr&s <20>rr%zEventsMixin.__init__<5F>s\<00><><00><18><05><07><07><18>$<24>)<29>&<26>)<29>)<29>)<29>"<22>W<EFBFBD>W<EFBFBD><04><1A>$<24>w<EFBFBD>w<EFBFBD><04><1C> <20><04><19>!<21>-<2D>3<>3<>5<>5<><04><1A><1A>rc#<00><>K<00>tt|<00><00><00><00>D]8}tt|<00><00>|<01><00>}t|t<00><00>r|V<00><00>9dS)zr
Generator function which yields all :class:`event` instances defined
against this class.
N)rprfr;r=rN)rrhris r<00> _all_eventszEventsMixin._all_events<74>s^<00><00><00><00>
<18><04>T<EFBFBD>
<EFBFBD>
<EFBFBD>O<EFBFBD>O<EFBFBD> <1A> <1A>D<EFBFBD><19>$<24>t<EFBFBD>*<2A>*<2A>d<EFBFBD>+<2B>+<2B>C<EFBFBD><19>#<23>u<EFBFBD>%<25>%<25> <1A><19> <09> <09> <09><> <1A> rc<00><><00><01>|<00><00><00>D](} |jt|<00><00>=<00>#t$rY<00>%wxYwt <00><00><00><00><00>dSr+)r~rPrarkr$r-)r<00>evr)s <20>rr-zEventsMixin.closesk<00><><00><16>"<22>"<22>$<24>$<24> <15> <15>B<EFBFBD> <15><16>K<EFBFBD><02>4<EFBFBD><08><08>)<29>)<29><><1B> <15> <15> <15><14><04> <15><><EFBFBD><EFBFBD> <0A><07><07> <0A> <0A><0F><0F><0F><0F>s <00>/<02>
<<05><Nc<00>6<00>|j<00>|<01><00>S)aM
Pause the script until the device is activated, or the timeout is
reached.
:type timeout: float or None
:param timeout:
Number of seconds to wait before proceeding. If this is
:data:`None` (the default), then wait indefinitely until the device
is active.
)rwr1<00>r<00>timeouts r<00>wait_for_activezEventsMixin.wait_for_active s<00><00><14>!<21>&<26>&<26>w<EFBFBD>/<2F>/<2F>/rc<00>6<00>|j<00>|<01><00>S)aQ
Pause the script until the device is deactivated, or the timeout is
reached.
:type timeout: float or None
:param timeout:
Number of seconds to wait before proceeding. If this is
:data:`None` (the default), then wait indefinitely until the device
is inactive.
)rxr1r<>s r<00>wait_for_inactivezEventsMixin.wait_for_inactives<00><00><14>#<23>(<28>(<28><17>1<>1<>1ra
The function to run when the device changes state from inactive to
active.
This can be set to a function which accepts no (mandatory) parameters,
or a Python function which accepts a single mandatory parameter (with
as many optional parameters as you like). If the function accepts a
single mandatory parameter, the device that activated it will be passed
as that parameter.
Set this property to :data:`None` (the default) to disable the event.
a

The function to run when the device changes state from active to
inactive.
This can be set to a function which accepts no (mandatory) parameters,
or a Python function which accepts a single mandatory parameter (with
as many optional parameters as you like). If the function accepts a
single mandatory parameter, the device that deactivated it will be
passed as that parameter.
Set this property to :data:`None` (the default) to disable the event.
c<00><><00>|j<00><00><00>r7|j<00>|j<00><00><00>|j<00><00>SdS)z<>
The length of time (in seconds) that the device has been active for.
When the device is inactive, this is :data:`None`.
N)rw<00>is_setrz<00>
ticks_diffr{r|rs r<00> active_timezEventsMixin.active_timeAsW<00><00> <10> <1D> $<24> $<24> &<26> &<26> <18><17>#<23>.<2E>.<2E>t<EFBFBD>/?<3F>/E<>/E<>/G<>/G<>/3<>/A<>C<01>C<01> C<01><18>4rc<00><><00>|j<00><00><00>r7|j<00>|j<00><00><00>|j<00><00>SdS)z<>
The length of time (in seconds) that the device has been inactive for.
When the device is active, this is :data:`None`.
N)rxr<>rzr<>r{r|rs r<00> inactive_timezEventsMixin.inactive_timeMsW<00><00> <10> <1F> &<26> &<26> (<28> (<28> <18><17>#<23>.<2E>.<2E>t<EFBFBD>/?<3F>/E<>/E<>/G<>/G<>/3<>/A<>C<01>C<01> C<01><18>4rc<00>@<00>|jr|<00><00><00>dSdSr+)<01>when_activatedrs r<00>_fire_activatedzEventsMixin._fire_activatedYs/<00><00> <0F> <1E> "<22> <10> <1F> <1F> !<21> !<21> !<21> !<21> !<21> "<22> "rc<00>@<00>|jr|<00><00><00>dSdSr+)<01>when_deactivatedrs r<00>_fire_deactivatedzEventsMixin._fire_deactivated^s/<00><00> <0F> <20> $<24> <10> !<21> !<21> #<23> #<23> #<23> #<23> #<23> $<24> $rc<00><><00>|j|c}|_|<03>8|r|j<00><00><00>dS|j<00><00><00>dS||kr<>||_|rH|j<00><00><00>|j<00><00><00>|<00><00><00>dS|j<00><00><00>|j<00><00><00>|<00><00><00>dSdS)aW
This method should be called by descendents whenever the
:attr:`~Device.is_active` property is likely to have changed (for
example, in response to a pin's :attr:`~gpiozero.Pin.state` changing).
The *ticks* parameter must be set to the time when the change occurred;
this can usually be obtained from the pin factory's
:meth:`gpiozero.Factory.ticks` method but some pin implementations will
implicitly provide the ticks when an event occurs as part of their
reporting mechanism.
The *new_active* parameter must be set to the device's
:attr:`~Device.is_active` value at the time indicated by *ticks* (which
is not necessarily the value of :attr:`~Device.is_active` right now, if
the pin factory provides means of reporting a pin's historical state).
N)ryrw<00>setrxr|<00>clearr<72>r<>)rr{<00>
new_active<EFBFBD>
old_actives r<00> _fire_eventszEventsMixin._fire_eventscs<00><00>")-<2D>(9<>:<3A>%<25>
<EFBFBD>D<EFBFBD>%<25> <15> <1D><1A> +<2B><14>"<22>&<26>&<26>(<28>(<28>(<28>(<28>(<28><14>$<24>(<28>(<28>*<2A>*<2A>*<2A>*<2A>*<2A> <17>:<3A> %<25> %<25>!&<26>D<EFBFBD> <1E><19> )<29><14>$<24>*<2A>*<2A>,<2C>,<2C>,<2C><14>"<22>&<26>&<26>(<28>(<28>(<28><14>$<24>$<24>&<26>&<26>&<26>&<26>&<26><14>"<22>(<28>(<28>*<2A>*<2A>*<2A><14>$<24>(<28>(<28>*<2A>*<2A>*<2A><14>&<26>&<26>(<28>(<28>(<28>(<28>(<28>&<26> %rc<00><00>dS)a<>
This is a stub method that only exists to be overridden by descendents.
It is called when :class:`event` properties are assigned (including
when set to :data:`None) to permit the owning instance to activate or
deactivate monitoring facilities.
For example, if a descendent requires a background thread to monitor a
device, it would be preferable to only run the thread if event handlers
are present to respond to it.
The *enabled* parameter is :data:`False` when all :class:`event`
properties on the owning class are :data:`None`, and :data:`True`
otherwise.
Nr)rrrs rrqzEventsMixin._start_stop_events<74>s <00><00> <0A>rr+)rrrrr%r~r-r<>r<>rNr<>r<>rr<>r<>r<>r<>r<>rqr@rAs@rruru<00>s6<00><><00><00><00><00><00> <08> <08>6<>6<>6<>6<>6<><1A><1A><1A><18><18><18><18><18> 0<> 0<> 0<> 0<> 2<> 2<> 2<> 2<><1B>U<EFBFBD> <0C>  <0A>  <0A>N<EFBFBD><1D>u<EFBFBD> <0C>  <0A>  <0A><14><0E> <18> <18><0E>X<EFBFBD> <18><0E> <18> <18><0E>X<EFBFBD> <18>"<22>"<22>"<22>
$<24>$<24>$<24>
")<29>")<29>")<29>H <0A> <0A> <0A> <0A> <0A> <0A> rruc<00><><00><00>eZdZdZ<03>fd<02>Z<04>fd<03>Z<05>fd<04>Z<06>fd<05>Zd<06>Ze d<07><00>Z
e d<08><00><00>Z e j d <09><00><00>Z e d
<EFBFBD><00><00>Zej d <0B><00><00>Ze d <0C><00><00>Ze d <0A><00><00>Z<10>xZS)<0E> HoldMixinz<6E>
Extends :class:`EventsMixin` to add the :attr:`when_held` event and the
machinery to fire that event repeatedly (when :attr:`hold_repeat` is
:data:`True`) at internals defined by :attr:`hold_time`.
c<00><><00><01>d|_t<00><00>j|i|<02><01>d|_d|_d|_d|_t|<00><00>|_dS)NrF)<08> _hold_threadr$r%<00>
_when_held<EFBFBD>
_held_from<EFBFBD>
_hold_time<EFBFBD> _hold_repeat<61>
HoldThreadr&s <20>rr%zHoldMixin.__init__<5F>sZ<00><><00> <20><04><19><18><05><07><07><18>$<24>)<29>&<26>)<29>)<29>)<29><1E><04><0F><1E><04><0F><1B><04><0F>!<21><04><19>&<26>t<EFBFBD>,<2C>,<2C><04><19><19>rc<00><><00><01>|j<00>|j<00><00><00>d|_t<00><00><00><00><00>dSr+)r<>r<r$r-r.s <20>rr-zHoldMixin.close<73>s><00><><00> <0F> <1C> (<28> <10> <1D> "<22> "<22> $<24> $<24> $<24> <20><04><19> <0A><07><07> <0A> <0A><0F><0F><0F><0F>rc<00><><00><01>t<00><00><00><00><00>|jj<00><00><00>dSr+)r$r<>r<><00>holdingr<67>r.s <20>rr<>zHoldMixin._fire_activated<65>s7<00><><00> <0A><07><07><1F><1F>!<21>!<21>!<21> <0C><19>!<21>%<25>%<25>'<27>'<27>'<27>'<27>'rc<00>V<00><01>d|_t<00><00><00><00><00>dSr+)r<>r$r<>r.s <20>rr<>zHoldMixin._fire_deactivated<65>s&<00><><00><1E><04><0F> <0A><07><07>!<21>!<21>#<23>#<23>#<23>#<23>#rc<00>@<00>|jr|<00><00><00>dSdSr+)<01> when_heldrs r<00>
_fire_heldzHoldMixin._fire_held<6C>s,<00><00> <0F>><3E> <1D> <10>N<EFBFBD>N<EFBFBD> <1C> <1C> <1C> <1C> <1C> <1D> ra
The function to run when the device has remained active for
:attr:`hold_time` seconds.
This can be set to a function which accepts no (mandatory) parameters,
or a Python function which accepts a single mandatory parameter (with
as many optional parameters as you like). If the function accepts a
single mandatory parameter, the device that activated will be passed
as that parameter.
Set this property to :data:`None` (the default) to disable the event.
c<00><00>|jS)a 
The length of time (in seconds) to wait after the device is activated,
until executing the :attr:`when_held` handler. If :attr:`hold_repeat`
is True, this is also the length of time between invocations of
:attr:`when_held`.
)r<>rs r<00> hold_timezHoldMixin.hold_time<6D>s <00><00><14><EFBFBD>rc<00>X<00>|dkrtd<02><00><00>t|<01><00>|_dS)Nrzhold_time must be 0 or greater)r r7r<>r8s rr<>zHoldMixin.hold_time<6D>s+<00><00> <10>1<EFBFBD>9<EFBFBD>9<EFBFBD><1D>><3E>?<3F>?<3F> ?<3F><1F><05>,<2C>,<2C><04><0F><0F>rc<00><00>|jS)z<>
If :data:`True`, :attr:`when_held` will be executed repeatedly with
:attr:`hold_time` seconds between each invocation.
)r<>rs r<00> hold_repeatzHoldMixin.hold_repeat<61>s <00><00> <14> <20> rc<00>.<00>t|<01><00>|_dSr+)<02>boolr<6C>r8s rr<>zHoldMixin.hold_repeat<61>s<00><00> <20><15>K<EFBFBD>K<EFBFBD><04><19><19>rc<00><00>|jduS)zo
When :data:`True`, the device has been active for at least
:attr:`hold_time` seconds.
N)r<>rs r<00>is_heldzHoldMixin.is_held<6C>s<00><00> <14><EFBFBD>d<EFBFBD>*<2A>*rc<00><><00>|j<00>7|j<00>|j<00><00><00>|j<00><00>SdS)aO
The length of time (in seconds) that the device has been held for.
This is counted from the first execution of the :attr:`when_held` event
rather than when the device activated, in contrast to
:attr:`~EventsMixin.active_time`. If the device is not currently held,
this is :data:`None`.
N)r<>rzr<>r{rs r<00> held_timezHoldMixin.held_time<6D>sG<00><00> <10>?<3F> &<26><17>#<23>.<2E>.<2E>t<EFBFBD>/?<3F>/E<>/E<>/G<>/G<>/3<><EFBFBD>@<01>@<01> @<01><18>4r)rrrrr%r-r<>r<>r<>rNr<>rr<>r?r<>r<>r<>r@rAs@rr<>r<><00>s^<00><><00><00><00><00><00><08><08>
-<2D>-<2D>-<2D>-<2D>-<2D><18><18><18><18><18> (<28>(<28>(<28>(<28>(<28>$<24>$<24>$<24>$<24>$<24><1D><1D><1D><16><05> <0C>  <0A>  <0A>I<EFBFBD><0E><1F><1F><0E>X<EFBFBD><1F><0F><15>'<27>'<27><16><15>'<27>
<0E>!<21>!<21><0E>X<EFBFBD>!<21><11><17>(<28>(<28><18><17>(<28><0E>+<2B>+<2B><0E>X<EFBFBD>+<2B><0E> <18> <18><0E>X<EFBFBD> <18> <18> <18> <18> rr<>c<00>(<00><00>eZdZdZ<03>fd<02>Zd<03>Z<05>xZS)r<>z<>
Extends :class:`GPIOThread`. Provides a background thread that repeatedly
fires the :attr:`HoldMixin.when_held` event as long as the owning
device is active.
c<00><><00><01>t<00><00><00>|jtj|<01><00>f<01><01><00>t <00><00>|_|<00><00><00>dS)N)<02>targetr')r$r%<00>held<6C>weakref<65>proxyrr<>r>)r<00>parentr)s <20>rr%zHoldThread.__init__sT<00><><00> <0A><07><07><18><18><17>9<EFBFBD>G<EFBFBD>M<EFBFBD>&<26>$9<>$9<>#;<3B> <19> =<3D> =<3D> =<3D><1C>w<EFBFBD>w<EFBFBD><04> <0C> <0C>
<EFBFBD>
<EFBFBD> <0C> <0C> <0C> <0C> rc<00>Z<00> |j<00><00><00>s<>|j<00>d<01><00>r<>|j<00><00><00>|j<00><00><00>s<>|j<00>|j<00><00>sy|j<00>|j<00> <00><00>|_|<01>
<00><00>|j sn8|j<00><00><00>s|j<00>|j<00><00><00>y|j<00><00><00><00><>dSdS#t$rYdSwxYw)Ng<4E><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?) r0r<>r<>r1r<>rxr<>r<>rzr{r<>r<><00>ReferenceError)rr<>s rr<>zHoldThread.heldsA<00><00> <11><1A>m<EFBFBD>*<2A>*<2A>,<2C>,<2C> "<22><17><<3C>$<24>$<24>S<EFBFBD>)<29>)<29>
"<22><18>L<EFBFBD>&<26>&<26>(<28>(<28>(<28> <20>M<EFBFBD>0<>0<>2<>2<>"<22>"<22>2<>7<>7<><06>8H<38>I<>I<>"<22>"<22>,<2C>4<>06<30>0B<30>0H<30>0H<30>0J<30>0J<30>F<EFBFBD>-<2D><1E>)<29>)<29>+<2B>+<2B>+<2B>%<25>1<>"<22>!<21>!<21>M<EFBFBD>0<>0<>2<>2<>"<22>"<22>2<>7<>7<><06>8H<38>I<>I<>"<22><1B>m<EFBFBD>*<2A>*<2A>,<2C>,<2C> "<22> "<22> "<22> "<22> "<22><><1E> <11> <11> <11> <10>D<EFBFBD>D<EFBFBD> <11><><EFBFBD>s<00>DD<00>
D*<03>)D*)rrrrr%r<>r@rAs@rr<>r<><00>sQ<00><><00><00><00><00><00><08><08>
<15><15><15><15><15> <11><11><11><11><11><11>rr<>c<00>J<00><00>eZdZdZdddedf<05>fd<06> Zed<07><00><00>Zd<08>Z<08>xZ S) <09> GPIOQueueaF
Extends :class:`GPIOThread`. Provides a background thread that monitors a
device's values and provides a running *average* (defaults to median) of
those values. If the *parent* device includes the :class:`EventsMixin` in
its ancestry, the thread automatically calls
:meth:`~EventsMixin._fire_events`.
<20><00>FNc<00><><00><01>t|<05><00>sJ<00>|dkrtd<02><00><00>|dkrtd<04><00><00>|<06>t<00><00>}t <00><00><00>|j<00><05><00>t|<02><06><00>|_t|<04><00>|_
t|<03><00>|_ t<00><00>|_tj|<01><00>|_||_||_dS)Nrzqueue_len must be at least onerz sample_wait must be 0 or greater)r<>)<01>maxlen)rWr r r<>r$r%<00>fillr<00>queuer<65>rr7<00> sample_waitr<00>fullr<6C>r<>r<><00>average<67>ignore)rr<><00> queue_lenr<6E>rr<>r<>r)s <20>rr%zGPIOQueue.__init__#s<><00><><00><18><07> <20> <20> <20> <20> <20> <14>q<EFBFBD>=<3D>=<3D><1D>><3E>?<3F>?<3F> ?<3F> <16><11>?<3F>?<3F><1D>@<40>A<>A<> A<> <11>><3E><18>U<EFBFBD>U<EFBFBD>F<EFBFBD> <0A><07><07><18><18><04> <09><18>*<2A>*<2A>*<2A><1A>)<29>,<2C>,<2C>,<2C><04>
<EFBFBD><1B>G<EFBFBD>}<7D>}<7D><04> <0C> <20><1B>-<2D>-<2D><04><18><19>G<EFBFBD>G<EFBFBD><04> <09><1D>m<EFBFBD>F<EFBFBD>+<2B>+<2B><04> <0B><1E><04> <0C><1C><04> <0B> <0B> rc<00><><00>|js|j<00><00><00> |<00>|j<00><00>S#t
t f$rYdSwxYw)Nr<4E>)rr<>r1r<>r<><00>ZeroDivisionError<6F>
ValueErrorrs rrzGPIOQueue.value6s^<00><00><13>|<7C> <1D> <10>I<EFBFBD>N<EFBFBD>N<EFBFBD> <1C> <1C> <1C> <17><17><<3C><<3C><04>
<EFBFBD>+<2B>+<2B> +<2B><>!<21>:<3A>.<2E> <17> <17> <17><16>3<EFBFBD>3<EFBFBD> <17><><EFBFBD>s<00><<00>A<03>Ac<00><><00> |j<00>|j<00><00><00>s-|j<00><00><00>}||jvr|j<00>|<01><00>|j<00> <00><00>s;t|j<00><00>|jj kr|j<00> <00><00>|j s|j<00> <00><00>r[t|jt<00><00>rA|j<00>|jj<00><00><00>|jj<00><00>|j<00>|j<00><00><00><01>+dSdS#t($rYdSwxYwr+)r0r1r<>r<><00>_readr<64>r<><00>appendr<64>r<><00>lenr<6E>r<>rr=rur<>rzr{<00> is_activer<65>r8s rr<>zGPIOQueue.fill@sS<00><00> <11><1A>m<EFBFBD>(<28>(<28><14>)9<>:<3A>:<3A> e<01><1C> <0B>)<29>)<29>+<2B>+<2B><05><18><04> <0B>+<2B>+<2B><18>J<EFBFBD>%<25>%<25>e<EFBFBD>,<2C>,<2C>,<2C><1B>y<EFBFBD>'<27>'<27>)<29>)<29>$<24>c<EFBFBD>$<24>*<2A>o<EFBFBD>o<EFBFBD><14><1A>AR<41>.R<>.R<><18>I<EFBFBD>M<EFBFBD>M<EFBFBD>O<EFBFBD>O<EFBFBD>O<EFBFBD><18>L<EFBFBD>e<01>D<EFBFBD>I<EFBFBD>$4<>$4<>$6<>$6<>e<01>J<EFBFBD>t<EFBFBD>{<7B>T_<54><`<60><`<60>e<01><18>K<EFBFBD>,<2C>,<2C>T<EFBFBD>[<5B>-D<>-J<>-J<>-L<>-L<>d<EFBFBD>k<EFBFBD>Nc<4E>d<>d<>d<><1B>m<EFBFBD>(<28>(<28><14>)9<>:<3A>:<3A> e<01> e<01> e<01> e<01> e<01><><1E> <11> <11> <11> <10>D<EFBFBD>D<EFBFBD> <11><><EFBFBD>s<00>E E<00>
E<03>E)
rrrrrr%rrr<>r@rAs@rr<>r<>s<00><><00><00><00><00><00><08><08>%&<26>3<EFBFBD><05><1A>4<EFBFBD><1D><1D><1D><1D><1D><1D>&<0E><17><17><0E>X<EFBFBD><17> <11> <11> <11> <11> <11> <11> rr<>)rYr<>rl<00> functoolsrr<00> threadingr<00> collectionsr<00>
statisticsr<00>threadsr <00>excr
r r r rrnrrrCrNrur<>r<>r<>rrr<00><module>r<>s?<00><01><0F><0E><0E><0E><0E><0E><0E><0E><0F><0F><0F><0F>$<24>$<24>$<24>$<24>$<24>$<24>$<24>$<24><1B><1B><1B><1B><1B><1B><1D><1D><1D><1D><1D><1D><1D><1D><1D><1D><1D><1D><1F><1F><1F><1F><1F><1F><06><06><06><06><06><06><06><06><06><06><06><06><06><06>N<01><11> <16><16><16><16><16><16><16><16>0<(<28><(<28><(<28><(<28><(<28><(<28><(<28><(<28>~"<22>"<22>"<22>"<22>"<22>"<22>"<22>"<22><I-<2D>I-<2D>I-<2D>I-<2D>I-<2D>I-<2D>I-<2D>I-<2D>Xr <0A>r <0A>r <0A>r <0A>r <0A>r <0A>r <0A>r <0A>j`<18>`<18>`<18>`<18>`<18> <0B>`<18>`<18>`<18>F<11><11><11><11><11><1A><11><11><11>>1<11>1<11>1<11>1<11>1<11>
<EFBFBD>1<11>1<11>1<11>1<11>1r