platypush/plugins/esp/__init__.py
def pwm_on(self, pin: Union[int, str], freq: Optional[int] = None, duty: Optional[int] = None, **kwargs):
        """
        Set the specified PIN to HIGH.

        :param pin: GPIO PIN number or configured name.
        :param freq: PWM PIN frequency.
        :param duty: PWM PIN duty cycle.
        :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}))

if {freq}:
    pin.freq({freq})
if {duty}:
    pin.duty({duty})

pin.on()
'''.format(pin=pin, freq=freq, duty=duty)

        self.execute(code, **kwargs)

        Set the specified PIN to HIGH.

        :param pin: GPIO PIN number or configured name.
        :param freq: PWM PIN frequency.
        :param duty: PWM PIN duty cycle.
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.execute`.
        
Set the specified PIN to HIGH.
Set the specified PIN to HIGH .
def pwm_on(self, pin: Union[int, str], freq: Optional[int] = None, duty: Optional[int] = None, **kwargs):
        device = self._get_device(**kwargs)
        pin = device.get_pin(pin)
        code = '''
import machine
pin = machine.PWM(machine.Pin({pin}))
if {freq}:
    pin.freq({freq})
if {duty}:
    pin.duty({duty})
pin.on()
'''.format(pin=pin, freq=freq, duty=duty)
        self.execute(code, **kwargs)
def pwm_on ( self , pin : Union [ int , str ] , freq : Optional [ int ] = None , duty : Optional [ int ] = None , ** kwargs ) : device = self . _get_device ( ** kwargs ) pin = device . get_pin ( pin ) code = '''
import machine
pin = machine.PWM(machine.Pin({pin}))

if {freq}:
    pin.freq({freq})
if {duty}:
    pin.duty({duty})

pin.on()
''' . format ( pin = pin , freq = freq , duty = duty ) self . execute ( code , ** kwargs )
Set the specified PIN to HIGH.
Set the specified PIN to HIGH .
"""
        Set the specified PIN to HIGH.

        :param pin: GPIO PIN number or configured name.
        :param freq: PWM PIN frequency.
        :param duty: PWM PIN duty cycle.
        :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]
PWM PIN frequency.
PWM PIN frequency .
duty
Optional[int]
PWM PIN duty cycle.
PWM PIN duty cycle .
kwargs
Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.execute`.
Parameters to pass to : meth : ` platypush . plugins . esp . EspPlugin . execute ` .