Skip to content

Commit

Permalink
Review --write-poweroff-timer option
Browse files Browse the repository at this point in the history
  • Loading branch information
Ircama committed Nov 11, 2023
1 parent 4e0f7ca commit 1889241
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,10 @@ It is tested with Ubuntu / Windows Subsystem for Linux, Windows.
## Usage

```
usage: epson_print_conf.py [-h] -m MODEL -a HOSTNAME [-p PORT] [-i] [-q QUERY_NAME]
[--reset_waste_ink] [-d]
[--write-first-ti-received-time YEAR MONTH DAY]
[--write-poweroff-timer MINUTES] [--dry-run] [-R ADDRESS_SET]
[-W ADDRESS_VALUE_SET] [-e FIRST_ADDRESS LAST_ADDRESS] [--detect-key]
[-S SEQUENCE_STRING] [-t TIMEOUT] [-r RETRIES] [-c CONFIG_FILE]
usage: epson_print_conf.py [-h] -m MODEL -a HOSTNAME [-p PORT] [-i] [-q QUERY_NAME] [--reset_waste_ink] [-d]
[--write-first-ti-received-time YEAR MONTH DAY] [--write-poweroff-timer MINUTES]
[--dry-run] [-R ADDRESS_SET] [-W ADDRESS_VALUE_SET] [-e FIRST_ADDRESS LAST_ADDRESS]
[--detect-key] [-S SEQUENCE_STRING] [-t TIMEOUT] [-r RETRIES] [-c CONFIG_FILE]
[--simdata SIMDATA_FILE]
optional arguments:
Expand All @@ -60,14 +58,13 @@ optional arguments:
--write-first-ti-received-time YEAR MONTH DAY
Change the first TI received time
--write-poweroff-timer MINUTES
Write poweroff tiler
Update the poweroff timer. Use 0xffff or 65535 to disable it.
--dry-run Dry-run change operations
-R ADDRESS_SET, --read-eeprom ADDRESS_SET
Read the values of a list of printer EEPROM addreses. Format is: address
[, ...]
Read the values of a list of printer EEPROM addreses. Format is: address [, ...]
-W ADDRESS_VALUE_SET, --write-eeprom ADDRESS_VALUE_SET
Write related values to a list of printer EEPROM addresses. Format is:
address: value [, ...]
Write related values to a list of printer EEPROM addresses. Format is: address: value
[, ...]
-e FIRST_ADDRESS LAST_ADDRESS, --eeprom-dump FIRST_ADDRESS LAST_ADDRESS
Dump EEPROM
--detect-key Detect the read_key via brute force
Expand All @@ -78,8 +75,8 @@ optional arguments:
-r RETRIES, --retries RETRIES
SNMP GET retries (floating point argument)
-c CONFIG_FILE, --config CONFIG_FILE
read a configuration file including the full log dump of a previous
operation with '-d' flag (instead of accessing the printer via SNMP)
read a configuration file including the full log dump of a previous operation with
'-d' flag (instead of accessing the printer via SNMP)
--simdata SIMDATA_FILE
write SNMP dictionary map to simdata file
Expand Down
9 changes: 6 additions & 3 deletions epson_print_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,9 @@ def write_simdata(self, file):
import argparse
from pprint import pprint

def auto_int(x):
return int(x, 0)

parser = argparse.ArgumentParser(
epilog='Epson Printer Configuration via SNMP (TCP/IP)')

Expand All @@ -1721,7 +1724,7 @@ def write_simdata(self, file):
'-p',
'--port',
dest='port',
type=int,
type=auto_int,
default=161,
action="store",
help='Printer port (default is 161)')
Expand Down Expand Up @@ -1763,8 +1766,8 @@ def write_simdata(self, file):
parser.add_argument(
'--write-poweroff-timer',
dest='poweroff',
type=int,
help='Write poweroff tiler',
type=auto_int,
help='Update the poweroff timer. Use 0xffff or 65535 to disable it.',
nargs=1,
metavar=('MINUTES'),
)
Expand Down

0 comments on commit 1889241

Please sign in to comment.