Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix T201 #244

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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