(self, address=None, blid=None, password=None, topic="#",
                       roombaName="", file="./config.ini", log=None, webport=None)
address is the IP address of the Roomba,
        leave topic as is, unless debugging (# = all messages).
        if a python standard logging object called 'Roomba' exists,
        it will be used for logging,
        or pass a logging object
address is the IP address of the Roomba,
        leave topic as is, unless debugging (# = all messages).
        if a python standard logging object called 'Roomba' exists,
        it will be used for logging,
        or pass a logging object
address is the IP address of the Roomba leave topic as is unless debugging ( # = all messages ) . if a python standard logging object called Roomba exists it will be used for logging or pass a logging object
def __init__(self, address=None, blid=None, password=None, topic="#",
                       roombaName="", file="./config.ini", log=None, webport=None):
        '''
        address is the IP address of the Roomba,
        leave topic as is, unless debugging (# = all messages).
        if a python standard logging object called 'Roomba' exists,
        it will be used for logging,
        or pass a logging object
        '''
        self.loop = asyncio.get_event_loop()
        self.debug = False
        if log:
            self.log = log
        else:
            self.log = logging.getLogger("Roomba.{}".format(roombaName if roombaName else __name__))
        if self.log.getEffectiveLevel() == logging.DEBUG:
            self.debug = True
        self.address = address
        # set the following to True to enable pretty printing of json data
        self.pretty_print = False
        self.roomba_port = 8883
        self.blid = blid
        self.password = password
        self.roombaName = roombaName
        self.file = file
        self.get_passwd = Password(file=file)
        self.topic = topic
        self.webport = webport
        self.ws = None
        self.args = None    #shadow class variable
        self.mqttc = None
        self.local_mqtt = False
        self.exclude = ""
        self.roomba_connected = False
        self.indent = 0
        self.master_indent = 0
        self.raw = False
        self.drawmap = False
        self.mapSize = None
        self.roomba_angle = 0
        self.old_x_y = None
        self.fnt = None
        self.home_pos = None
        self.angle = 0
        self.invert_x = self.invert_y = None    #mirror x,y
        self.current_state = None
        self.simulation = False
        self.simulation_reset = False
        self.max_distance = 500             #max distance to draw lines
        self.icons = icons(base_icon=None, angle=self.angle, fnt=self.fnt, size=(32,32), log=self.log)
        self.base = None                    #base map
        self.room_outline_contour = None
        self.room_outline = None
        self.floorplan = None
        self.floorplan_size = None
        self.previous_display_text = self.display_text = None
        self.master_state = {}
        self.update_seconds = 300           #update with all values every 5 minutes
        self.show_final_map = True
        self.client = None                  #Roomba MQTT client
        self.roombas_config = {}            #Roomba configuration loaded from config file
        self.history = {}
        self.timers = {}
        self.flags = {}
        self.max_sqft = None
        self.cb = None
        
        self.is_connected = asyncio.Event(loop=self.loop)
        self.q = asyncio.Queue()
        self.command_q = asyncio.Queue()            
        self.loop.create_task(self.process_q())
        self.loop.create_task(self.process_command_q())
        self.update = self.loop.create_task(self.periodic_update())

        if not all([self.address, self.blid, self.password]):
            if not self.configure_roomba():
                self.log.critical('Could not configure Roomba')
        else:
            self.roombas_config = {self.address: {
                                   "blid": self.blid,
                                   "password": self.password,
                                   "roomba_name": self.roombaName}}
                                   
        if self.webport:
            self.setup_webserver()
def __init__ ( self , address = None , blid = None , password = None , topic = "#" , roombaName = "" , file = "./config.ini" , log = None , webport = None ) : self . loop = asyncio . get_event_loop ( ) self . debug = False if log : self . log = log else : self . log = logging . getLogger ( "Roomba.{}" . format ( roombaName if roombaName else __name__ ) ) if self . log . getEffectiveLevel ( ) == logging . DEBUG : self . debug = True self . address = address # set the following to True to enable pretty printing of json data self . pretty_print = False self . roomba_port = 8883 self . blid = blid self . password = password self . roombaName = roombaName self . file = file self . get_passwd = Password ( file = file ) self . topic = topic self . webport = webport self . ws = None self . args = None #shadow class variable self . mqttc = None self . local_mqtt = False self . exclude = "" self . roomba_connected = False self . indent = 0 self . master_indent = 0 self . raw = False self . drawmap = False self . mapSize = None self . roomba_angle = 0 self . old_x_y = None self . fnt = None self . home_pos = None self . angle = 0 self . invert_x = self . invert_y = None #mirror x,y self . current_state = None self . simulation = False self . simulation_reset = False self . max_distance = 500 #max distance to draw lines self . icons = icons ( base_icon = None , angle = self . angle , fnt = self . fnt , size = ( 32 , 32 ) , log = self . log ) self . base = None #base map self . room_outline_contour = None self . room_outline = None self . floorplan = None self . floorplan_size = None self . previous_display_text = self . display_text = None self . master_state = { } self . update_seconds = 300 #update with all values every 5 minutes self . show_final_map = True self . client = None #Roomba MQTT client self . roombas_config = { } #Roomba configuration loaded from config file self . history = { } self . timers = { } self . flags = { } self . max_sqft = None self . cb = None self . is_connected = asyncio . Event ( loop = self . loop ) self . q = asyncio . Queue ( ) self . command_q = asyncio . Queue ( ) self . loop . create_task ( self . process_q ( ) ) self . loop . create_task ( self . process_command_q ( ) ) self . update = self . loop . create_task ( self . periodic_update ( ) ) if not all ( [ self . address , self . blid , self . password ] ) : if not self . configure_roomba ( ) : self . log . critical ( 'Could not configure Roomba' ) else : self . roombas_config = { self . address : { "blid" : self . blid , "password" : self . password , "roomba_name" : self . roombaName } } if self . webport : self . setup_webserver ( )