Skip to content

Commit

Permalink
ykushcmd: Add string support to ykushcmd command
Browse files Browse the repository at this point in the history
By default ykushcmd command supports option to [on, off, cycle] whole
ykush yepkit.
> ykushcmd -u a  # 'a' stands for all ports
> ykushcmd -d a  # 'a' stands for all ports
In current build only int is supported for port number, changing it
to string allows to control power on all ports with one command instead
of 3 if there are 3 ports.

Signed-off-by: Redzynia, MateuszX <mateuszx.redzynia@intel.com>
  • Loading branch information
redzynix committed Sep 25, 2023
1 parent 342dc90 commit af7f668
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions labgrid/resource/ykushpowerport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

0 comments on commit af7f668

Please sign in to comment.