Skip to content

Commit

Permalink
always cast option to the correct type
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Sep 22, 2020
1 parent 83505c6 commit 6afb71d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aiokef/aiokef.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,9 @@ async def get_sub_db(self) -> int:

@retry(**_CMD_RETRY_KWARGS)
async def _set_dsp(self, which, value) -> None:
i = DSP_OPTION_MAPPING[which].index(value) + 128 # "+ 128" seems to do nothing
options = DSP_OPTION_MAPPING[which]
as_type = type(options[0])
i = options.index(as_type(value)) + 128 # "+ 128" seems to do nothing
cmd = COMMANDS[f"set_{which}"](i) # type: ignore
response = await self._comm.send_message(cmd)
if response != _RESPONSE_OK:
Expand Down

0 comments on commit 6afb71d

Please sign in to comment.