def __init__(self, bluetooth_adapter, bulb_version=7):
    self.available_cmds = [MagicBlueShell.Cmd('help', self.list_commands, False, help='Show this help'), MagicBlueShell.Cmd('list_devices', self.cmd_list_devices, False, help='List Bluetooth LE devices in range', aliases=['ls']), MagicBlueShell.Cmd('list_effects', self.cmd_list_effects, False, help='List available effects'), MagicBlueShell.Cmd('connect', self.cmd_connect, False, help='Connect to light bulb', params=['mac_address or ID']), MagicBlueShell.Cmd('disconnect', self.cmd_disconnect, True, help='Disconnect from current light bulb'), MagicBlueShell.Cmd('set_color', self.cmd_set_color, True, help="Change bulb's color", params=['name or hexadecimal value']), MagicBlueShell.Cmd('set_warm_light', self.cmd_set_warm_light, True, help='Set warm light', params=['intensity[0.0-1.0]']), MagicBlueShell.Cmd('set_effect', self.cmd_set_effect, True, help='Set an effect', params=['effect_name', 'speed[1-20]']), MagicBlueShell.Cmd('turn', self.cmd_turn, True, help='Turn on / off the bulb', params=['on|off']), MagicBlueShell.Cmd('read', self.cmd_read, True, help='Read device_info/datetime from the bulb', params=['name|device_info|date_time']), MagicBlueShell.Cmd('exit', self.cmd_exit, False, help='Exit the script')]
    self.bluetooth_adapter = bluetooth_adapter
    self._bulb_version = bulb_version
    self._magic_blue = None
    self._devices = []
    self.last_scan = None
def __init__(self, bluetooth_adapter, bulb_version=7):
    self.available_cmds = [MagicBlueShell.Cmd('help', self.list_commands, False, help='Show this help'), MagicBlueShell.Cmd('list_devices', self.cmd_list_devices, False, help='List Bluetooth LE devices in range', aliases=['ls']), MagicBlueShell.Cmd('list_effects', self.cmd_list_effects, False, help='List available effects'), MagicBlueShell.Cmd('connect', self.cmd_connect, False, help='Connect to light bulb', params=['mac_address or ID']), MagicBlueShell.Cmd('disconnect', self.cmd_disconnect, True, help='Disconnect from current light bulb'), MagicBlueShell.Cmd('set_color', self.cmd_set_color, True, help="Change bulb's color", params=['name or hexadecimal value']), MagicBlueShell.Cmd('set_warm_light', self.cmd_set_warm_light, True, help='Set warm light', params=['intensity[0.0-1.0]']), MagicBlueShell.Cmd('set_effect', self.cmd_set_effect, True, help='Set an effect', params=['effect_name', 'speed[1-20]']), MagicBlueShell.Cmd('turn', self.cmd_turn, True, help='Turn on / off the bulb', params=['on|off']), MagicBlueShell.Cmd('read', self.cmd_read, True, help='Read device_info/datetime from the bulb', params=['name|device_info|date_time']), MagicBlueShell.Cmd('exit', self.cmd_exit, False, help='Exit the script')]
    self.bluetooth_adapter = bluetooth_adapter
    self._bulb_version = bulb_version
    self._magic_blue = None
    self._devices = []
    self.last_scan = None