[Solved] Calling a subprocess, failure

Hello forum,
I’m trying my way to make the Asus Tinker Board’s GPIO I got the modules loading correctly. I have the only problem that init.py is calling a shell executable in a subprocess library.
The fact is that if I call the executable in a shell it works as expected, without root privileges. But inside HA, it doesn’t give any error but no actions is done.
This is the script:

"""Support for controlling GPIO pins of a Raspberry Pi."""
import logging
import shlex
import sys

from homeassistant.const import (
    EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP)
from subprocess import check_output, CalledProcessError

_LOGGER = logging.getLogger(__name__)

DOMAIN = 'asus_gpio'

def run_cmd(command, **options):
    """ Trying out the command or return None at failure."""

    if isinstance(command, str):
        command = shlex.split(command)
    test_cmd = ''
    if not options:
        options = {'universal_newlines' : True}
    try:
        test_cmd = check_output(command, **options)
    except (FileNotFoundError, CalledProcessError):
        return None
        _LOGGER.warning('Error executing %s' %command)
    sys.stdout.flush()
    sys.stderr.flush()
    return test_cmd

def setup(hass, config):
    """Set up the Asus Tinker Board component."""

    def cleanup_gpio(event):
        """Stuff to do before stopping."""
        if run_cmd('gpio exports'):
            run_cmd('gpio unexportall')

    def prepare_gpio(event):
        """Stuff to do when home assistant starts."""
        hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, cleanup_gpio)

    hass.bus.listen_once(EVENT_HOMEASSISTANT_START, prepare_gpio)
    return True


def setup_output(port, mode):
    """Set up a GPIO as output."""
    mode = mode.lower()
    if mode not in ("down", "up", "tri", "pwm", "out", "output"):
        _LOGGER.warning(" selected mode {} is not valid".format(mode))
    run_cmd("gpio mode {} {}".format(port,mode))


def setup_input(port, pull_mode):
    """Set up a GPIO as input."""
    mode = pull_mode.lower()
    if mode not in ("down", "up", "tri", "in", "input"):
        _LOGGER.warning(" selected mode {} is not valid".format(pull_mode))
    run_cmd("gpio mode {} {}".format(port,mode))


def write_output(port, value):
    """Write a value to a GPIO."""
    run_cmd("gpio write {} {}".format(port,value))


def read_input(port):
    """Read a value from a GPIO."""
    run_cmd("gpio read {}".format(port))

This is the gpio command is also available for raspberry.
I set the logging, but it’s not reporting even in the configuration.yaml is prepared like this:

logger:
  default: critical
  logs:
    home.assistant.components.asus_gpio: warning

For heaven’s sake don’t post links to search pages.

Sorry I copied the wrong link… An oversight :cry:
This is what I supposed to give.
So for an update I’m trying to debug the issue and if I run python I can call the operation with success.

>>> from components.asus_gpio import switch
>>> dir(switch)    
['AsusGPIOSwitch', 'CONF_INVERT_LOGIC', 'CONF_PORTS', 'CONF_PULL_MODE', 'DEFAULT_INVERT_LOGIC', 'DEFAULT_RELAY_TIME', 'DEVICE_DEFAULT_NAME', 'PLATFORM_SCHEMA', 'ToggleEntity', '_LOGGER', '_SWITCHES_SCHEMA', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'asus_gpio', 'cv', 'logging', 'setup_platform', 'vol']
>>> sw = switch.AsusGPIOSwitch
>>> test = sw('Gate',15, 0)   
>>> test
<Entity Gate: off>
>>> type(test)
<class 'components.asus_gpio.switch.AsusGPIOSwitch'>
>>> test.turn_on     
<bound method AsusGPIOSwitch.turn_on of <Entity Gate: off>>
>>> sw('Gate',15, 1)                # positive results
<Entity Gate: off>
>>> sw('Gate',15, 0)                # positive results
<Entity Gate: off>
>>> sw('Gate',16, 1)                # positive results
<Entity Gate: off>
>>> sw('Gate',16, 0)                # positive results
<Entity Gate: off>
>>> sw('Gate',1, 1)                # positive results
<Entity Gate: off>
>>> sw('Gate',1, 0)                # positive results
<Entity Gate: off>

But I started python with a different user. The user hass doesn’t exist. Is this the fault?

[root@alarm homeassistant]# su hass
This account is currently not available.
[root@alarm homeassistant]# users
myself

NO, I tested it.

try:

logger:
  default: critical
  logs:
    asus_gpio: warning

or

logger:
  default: critical
  logs:
    homeassistant.components.asus_gpio: warning

or

logger:
  default: critical
  logs:
    homeassistant.custom_components.asus_gpio: warning

I agree that the first is not leading to anywhere, but the latter is not my case, because I put the component into the python library (…/site-packages/homeassistant/components/).
There still a flaw that the main assert is not taken, and the system shows INFO, rather than CRITICAL.
BTW I don’t know whether is case sensitive.

EDIT
Using the

logger:
  default: critical
  logs:
    asus_gpio: warning

Is causing a overload that slowed down the system. So I removed to keep system smooth. But still no way to get the GPIO working.