Update entity.py

The entity definition will be a dictionary, so we should probably access it like one.