diff --git a/doc/configuration.rst b/doc/configuration.rst index f7c40605f..4faf746d9 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -303,7 +303,7 @@ hub. YKUSHPowerPort: serial: 'YK12345' - index: 1 + index: '1' The example describes port 1 on the YKUSH USB hub with the serial ``YK12345``. @@ -311,7 +311,8 @@ Use ``ykushcmd -l`` to get your serial number. Arguments: - serial (str): serial number of the YKUSH hub - - index (int): number of the port to switch + - index (str): number of the port to switch, use ``a`` to control the whole hub as one logical + port Used by: - `YKUSHPowerDriver`_ diff --git a/labgrid/resource/ykushpowerport.py b/labgrid/resource/ykushpowerport.py index b7a967816..be3b9c04f 100644 --- a/labgrid/resource/ykushpowerport.py +++ b/labgrid/resource/ykushpowerport.py @@ -11,10 +11,10 @@ class YKUSHPowerPort(Resource): Args: serial (str): serial of the YKUSH device - index (int): port index""" + index (str): port index""" serial = attr.ib(validator=attr.validators.instance_of(str)) - index = attr.ib(validator=attr.validators.instance_of(int), - converter=int) + index = attr.ib(validator=attr.validators.instance_of(str), + converter=str) @target_factory.reg_resource @attr.s(eq=False) @@ -23,7 +23,7 @@ class NetworkYKUSHPowerPort(NetworkResource): Args: serial (str): serial of the YKUSH device - index (int): port index""" + index (str): port index""" serial = attr.ib(validator=attr.validators.instance_of(str)) - index = attr.ib(validator=attr.validators.instance_of(int), - converter=int) + index = attr.ib(validator=attr.validators.instance_of(str), + converter=str)