platypush/plugins/esp/__init__.py
def pwm_freq(self, pin: Union[int, str], freq: Optional[int] = None, **kwargs) -> Optional[int]:
        """
        Get/set the frequency of a PWM PIN.

        :param pin: GPIO PIN number or configured name.
        :param freq: If set, set the frequency for the PIN in Hz.
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.execute`.
        """
        device = self._get_device(**kwargs)
        pin = device.get_pin(pin)
        code = '''
import machine
pin = machine.PWM(machine.Pin({pin}))
pin.freq({freq})
'''.format(pin=pin, freq=freq if freq else '')

        ret = self.execute(code, **kwargs).output
        if not freq:
            return int(ret)

        Get/set the frequency of a PWM PIN.

        :param pin: GPIO PIN number or configured name.
        :param freq: If set, set the frequency for the PIN in Hz.
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.execute`.
        
Get/set the frequency of a PWM PIN.
Get / set the frequency of a PWM PIN .
def pwm_freq(self, pin: Union[int, str], freq: Optional[int] = None, **kwargs) -> Optional[int]:
        device = self._get_device(**kwargs)
        pin = device.get_pin(pin)
        code = '''
import machine
pin = machine.PWM(machine.Pin({pin}))
pin.freq({freq})
'''.format(pin=pin, freq=freq if freq else '')
        ret = self.execute(code, **kwargs).output
        if not freq:
            return int(ret)
def pwm_freq ( self , pin : Union [ int , str ] , freq : Optional [ int ] = None , ** kwargs ) -> Optional [ int ] : device = self . _get_device ( ** kwargs ) pin = device . get_pin ( pin ) code = '''
import machine
pin = machine.PWM(machine.Pin({pin}))
pin.freq({freq})
''' . format ( pin = pin , freq = freq if freq else '' ) ret = self . execute ( code , ** kwargs ) . output if not freq : return int ( ret )
Get/set the frequency of a PWM PIN.
Get / set the frequency of a PWM PIN .
"""
        Get/set the frequency of a PWM PIN.

        :param pin: GPIO PIN number or configured name.
        :param freq: If set, set the frequency for the PIN in Hz.
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.execute`.
        """
self
pin
Union[int, str]
GPIO PIN number or configured name.
GPIO PIN number or configured name .
freq
Optional[int]
If set, set the frequency for the PIN in Hz.
If set set the frequency for the PIN in Hz .
kwargs
Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.execute`.
Parameters to pass to : meth : ` platypush . plugins . esp . EspPlugin . execute ` .