def got_button(bd_addr):
cc = fliclib.ButtonConnectionChannel(bd_addr)
# Assign function to call when a button is clicked
cc.on_button_single_or_double_click_or_hold = click_handler
cc.on_connection_status_changed = \
lambda channel, connection_status, disconnect_reason: \
log.info(channel.bd_addr + " " + str(connection_status) + (" " + str(disconnect_reason) if connection_status == fliclib.ConnectionStatus.Disconnected else ""))
client.add_connection_channel(cc)
评论列表
文章目录