def METHOD_NAME(self, origin, state):
    self.text_status.SetValue(str(state))
    self.state = state
    if state == "uninitialized" or state == "disconnected":
        self.button_device_connect.SetBackgroundColour("#ffff00")
        self.button_device_connect.SetLabel(_("Connect"))
        self.button_device_connect.SetBitmap(
            icons8_disconnected_50.GetBitmap(use_theme=False)
        )
        self.button_device_connect.Enable()
    elif state == "connected":
        self.button_device_connect.SetBackgroundColour("#00ff00")
        self.button_device_connect.SetLabel(_("Disconnect"))
        self.button_device_connect.SetBitmap(
            icons8_connected_50.GetBitmap(use_theme=False)
        )
        self.button_device_connect.Enable()