Skip to content

Commit

Permalink
Add underscores in numerical trays
Browse files Browse the repository at this point in the history
  • Loading branch information
nielstron committed Sep 24, 2020
1 parent 4dc9289 commit bb8312b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pysyncthru/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ def input_tray_status(self, filter_supported: bool = True) -> Dict[int, Any]:
"""Return the state of all input trays."""
tray_status = {}
for tray in (
*("{}{}".format(SyncThru.TRAY, i) for i in range(1, 6)),
"mp",
*("{}_{}".format(SyncThru.TRAY, i) for i in range(1, 6)),
"mp", # TODO what does mp stand for?
"manual",
):
try:
tray_stat = self.data.get(tray, {})
tray_stat = self.data.get(tray.replace("_", ""), {})
if filter_supported and tray_stat.get("opt", 0) != 1:
continue
else:
Expand Down
12 changes: 6 additions & 6 deletions pysyncthru/tests/test_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_input_tray_filter(self):
self.assertEqual(
self.syncthru.input_tray_status(True),
{
"tray1": {
"tray_1": {
"capa": 150,
"newError": "",
"opt": 1,
Expand All @@ -108,7 +108,7 @@ def test_input_tray_no_filter(self):
self.assertEqual(
self.syncthru.input_tray_status(False),
{
"tray1": {
"tray_1": {
"capa": 150,
"newError": "",
"opt": 1,
Expand All @@ -117,7 +117,7 @@ def test_input_tray_no_filter(self):
"paper_type1": 2,
"paper_type2": 0,
},
"tray2": {
"tray_2": {
"capa": 0,
"newError": "",
"opt": 0,
Expand All @@ -126,7 +126,7 @@ def test_input_tray_no_filter(self):
"paper_type1": 2,
"paper_type2": 0,
},
"tray3": {
"tray_3": {
"capa": 0,
"newError": "",
"opt": 0,
Expand All @@ -135,7 +135,7 @@ def test_input_tray_no_filter(self):
"paper_type1": 2,
"paper_type2": 0,
},
"tray4": {
"tray_4": {
"capa": 0,
"newError": "",
"opt": 0,
Expand All @@ -144,7 +144,7 @@ def test_input_tray_no_filter(self):
"paper_type1": 2,
"paper_type2": 0,
},
"tray5": {
"tray_5": {
"opt": 0,
"paper_size1": 0,
"paper_size2": 0,
Expand Down

0 comments on commit bb8312b

Please sign in to comment.