I don't see you setting any categories. Use addCategory()
to add categories.
Or even much more intuitive (modified from the example in Lawhead QGIS Python programming cookbook, pp 142):
# next line is pseudo code !! Replace and extent with your values !!
# my_classes = {class_value: (symbol_property, label_text), ...}
# for example:
my_classes = {1: ('yellow', 'First'),
2: ('red', 'Second'),
3: ('green', 'Third'),
4: ('blue', 'Fourth')}
categories = []
for class_value, (symbol_property, label_text) in my_classes.items():
# get default symbol for this geometry type
symbol = QgsSymbolV2.defaultSymbol(vector.geometryType())
# set symbol properties as you like
# symbol.set*(symbol_property)
symbol.setColor(QColor(symbol_property))
# create a category with these properties
category = QgsRendererCategoryV2(class_value, symbol, label_text)
categories.append(category)
mi_rend = QgsCategorizedSymbolRendererV2('ESTRELLA', categories)
vector.setRendererV2(mi_rend)
In this example category values, symbol properties (such as color, size, svg filename), and label strings are put into a dict. Then a loop picks each dict element one by one, creates a renderer category, and saves it in a list. Finally the renderer is initialized with this list of categories and assigned to the layer.