'Parse data sent by gateway.'

def parse_data(self, data):

    if ('status' in data):
        self._hass.bus.fire('cube_action', {'entity_id': self.entity_id, 'action_type': data['status']})
    if ('rotate' in data):
        self._hass.bus.fire('cube_action', {'entity_id': self.entity_id, 'action_type': 'rotate', 'action_value': float(data['rotate'].replace(',', '.'))})
    return False
