Skip to content

Commit

Permalink
Fix T201 (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek committed Feb 21, 2024
1 parent 746067e commit 70d4e5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ ignore = [
"RET507",
"SIM102",
"SLF001",
"T201",
]
select = ["ALL"]

Expand Down
13 changes: 8 additions & 5 deletions roombapy/entry_points.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import logging
import sys

from roombapy import RoombaFactory
from roombapy.discovery import RoombaDiscovery
from roombapy.getpassword import RoombaPassword

LOGGER = logging.getLogger(__name__)


def discovery():
roomba_ip = _get_ip_from_arg()

roomba_discovery = RoombaDiscovery()
if roomba_ip is not None:
print(roomba_discovery.find(roomba_ip))
LOGGER.info(roomba_discovery.find(roomba_ip))
return

robots_info = roomba_discovery.find()
for robot in robots_info:
print(robot)
LOGGER.info(robot)


def password():
Expand All @@ -30,7 +33,7 @@ def password():
roomba_password = RoombaPassword(roomba_ip)
found_password = roomba_password.get_password()
roomba_info.password = found_password
print(roomba_info)
LOGGER.info(roomba_info)


def connect():
Expand All @@ -47,7 +50,7 @@ def connect():
roomba = RoombaFactory.create_roomba(
roomba_info.ip, roomba_info.blid, roomba_password
)
roomba.register_on_message_callback(lambda msg: print(msg))
roomba.register_on_message_callback(lambda msg: LOGGER.info(msg))
roomba.connect()

while True:
Expand All @@ -70,7 +73,7 @@ def _validate_roomba_info(roomba_info):


def _wait_for_input():
print(
LOGGER.info(
"Roomba have to be on Home Base powered on.\n"
"Press and hold HOME button until you hear series of tones.\n"
"Release button, Wi-Fi LED should be flashing"
Expand Down

0 comments on commit 70d4e5b

Please sign in to comment.