def get_relay_state(self):
        """Get the relay state."""
        self.get_status()
        try:
            self.state = self.data['relay']
        except TypeError:
            self.state = False

        return bool(self.state)
Get the relay state.