pybecker/becker.py
async def init_unconfigured_unit(self, channel, name=None):
        """Init unconfigured units in database and send init call"""
        # check if unit is configured
        un, ch = self._split_channel(channel)   # pylint: disable=unused-variable
        unit = self.db.get_unit(un)
        if unit[2] == 0:
            _LOGGER.warning(
                "Unit %s%s with channel %s not registered in database file %s!",
                un,
                " of " + name if name is not None else "",
                channel,
                self.db.filename,
            )
            # set the unit as configured
            unit[1] = randrange(10, 40, 1)
            unit[2] = 1
            self.db.set_unit(unit)
            # send init call to sync with database (5 required for my Roto cover)
            for init_call_count in range(1,6):
                _LOGGER.debug(
                    "Init call to %s:%s #%d", un, 1, init_call_count)
                await self.stop(':'.join((str(un), '1')))
                # 0.5 to 0.9 seconds (works with my Roto cover)
                time.sleep(randrange(5, 10, 1) / 10)
Init unconfigured units in database and send init call
Init unconfigured units in database and send init call
Init unconfigured units in database and send init call
async def init_unconfigured_unit(self, channel, name=None):
        un, ch = self._split_channel(channel)   
        unit = self.db.get_unit(un)
        if unit[2] == 0:
            _LOGGER.warning(
                "Unit %s%s with channel %s not registered in database file %s!",
                un,
                " of " + name if name is not None else "",
                channel,
                self.db.filename,
            )
            unit[1] = randrange(10, 40, 1)
            unit[2] = 1
            self.db.set_unit(unit)
            for init_call_count in range(1,6):
                _LOGGER.debug(
                    "Init call to %s:%s #%d", un, 1, init_call_count)
                await self.stop(':'.join((str(un), '1')))
                time.sleep(randrange(5, 10, 1) / 10)
async def init_unconfigured_unit ( self , channel , name = None ) : un , ch = self . _split_channel ( channel ) unit = self . db . get_unit ( un ) if unit [ 2 ] == 0 : _LOGGER . warning ( "Unit %s%s with channel %s not registered in database file %s!" , un , " of " + name if name is not None else "" , channel , self . db . filename , ) unit [ 1 ] = randrange ( 10 , 40 , 1 ) unit [ 2 ] = 1 self . db . set_unit ( unit ) for init_call_count in range ( 1 , 6 ) : _LOGGER . debug ( "Init call to %s:%s #%d" , un , 1 , init_call_count ) await self . stop ( ':' . join ( ( str ( un ) , '1' ) ) ) time . sleep ( randrange ( 5 , 10 , 1 ) / 10 )
Init unconfigured units in database and send init call
Init unconfigured units in database and send init call
"""Init unconfigured units in database and send init call""" # check if unit is configured # pylint: disable=unused-variable # set the unit as configured # send init call to sync with database (5 required for my Roto cover) # 0.5 to 0.9 seconds (works with my Roto cover)
self
channel
name