Skip to content

Commit dbd4b11

Browse files
Merge pull request #1272 from redzynix/redzynix-add-string-support-to-ykushpowerport
ykushcmd: Add string support to ykushcmd command
2 parents d02396e + bafb51a commit dbd4b11

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

doc/configuration.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,15 +303,16 @@ hub.
303303
304304
YKUSHPowerPort:
305305
serial: 'YK12345'
306-
index: 1
306+
index: '1'
307307
308308
The example describes port 1 on the YKUSH USB hub with the
309309
serial ``YK12345``.
310310
Use ``ykushcmd -l`` to get your serial number.
311311

312312
Arguments:
313313
- serial (str): serial number of the YKUSH hub
314-
- index (int): number of the port to switch
314+
- index (str): number of the port to switch, use ``a`` to control the whole hub as one logical
315+
port
315316

316317
Used by:
317318
- `YKUSHPowerDriver`_

labgrid/resource/ykushpowerport.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ class YKUSHPowerPort(Resource):
1111
1212
Args:
1313
serial (str): serial of the YKUSH device
14-
index (int): port index"""
14+
index (str): port index"""
1515
serial = attr.ib(validator=attr.validators.instance_of(str))
16-
index = attr.ib(validator=attr.validators.instance_of(int),
17-
converter=int)
16+
index = attr.ib(validator=attr.validators.instance_of(str),
17+
converter=str)
1818

1919
@target_factory.reg_resource
2020
@attr.s(eq=False)
@@ -23,7 +23,7 @@ class NetworkYKUSHPowerPort(NetworkResource):
2323
2424
Args:
2525
serial (str): serial of the YKUSH device
26-
index (int): port index"""
26+
index (str): port index"""
2727
serial = attr.ib(validator=attr.validators.instance_of(str))
28-
index = attr.ib(validator=attr.validators.instance_of(int),
29-
converter=int)
28+
index = attr.ib(validator=attr.validators.instance_of(str),
29+
converter=str)

0 commit comments

Comments
 (0)