def update(self):
        import mpd
        try:
            self.status = self.client.status()
            self.currentsong = self.client.currentsong()
        except mpd.ConnectionError:
            self.client.connect(self.server, self.port)

            if self.password is not None:
                self.client.password(self.password)

            self.status = self.client.status()
            self.currentsong = self.client.currentsong()
Get the latest data and update the state.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/media_player/mpd.py/MpdDevice.update