'Convert to an HA state object.'

def to_native(self):

    try:
        return State(self.entity_id, self.state, json.loads(self.attributes), _process_timestamp(self.last_changed), _process_timestamp(self.last_updated))
    except ValueError:
        _LOGGER.exception('Error    converting    row    to    state:    %s', self)
        return None
