Skip to content

Commit

Permalink
fix pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew (from workstation) committed Jan 1, 2021
1 parent a1c5119 commit 2f24008
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
10 changes: 5 additions & 5 deletions smart_tv_telegram/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ async def _device_player_function(self, _: Client, message: CallbackQuery):
await message.answer("wrong callback")

try:
f = next(
device_function = next(
f_v
for f in self._functions.values()
for f_k, f_v in f.items()
Expand All @@ -140,14 +140,14 @@ async def _device_player_function(self, _: Client, message: CallbackQuery):
await message.answer("stream closed")
return

if not await f.is_enabled(self._config):
if not await device_function.is_enabled(self._config):
await message.answer("function not enabled")
return

with async_timeout.timeout(self._config.device_request_timeout) as cm:
await f.handle(self._mtproto)
with async_timeout.timeout(self._config.device_request_timeout) as timeout_context:
await device_function.handle(self._mtproto)

if cm.expired:
if timeout_context.expired:
await message.answer("request timeout")
else:
await message.answer("done")
Expand Down
3 changes: 0 additions & 3 deletions smart_tv_telegram/devices/web_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ async def handle(self, request: Request) -> Response:

return Response(status=200, body=url_to_play)

def get_player_functions(self) -> typing.List[DevicePlayerFunction]:
return []


class WebDeviceFinder(DeviceFinder):
_devices: typing.Dict[WebDevice, AsyncDebounce]
Expand Down

0 comments on commit 2f24008

Please sign in to comment.