'Return the state of the sensor.'

@property
def state(self):

    network_sensors = ['network_up', 'network_down']
    memory_sensors = ['memory_size', 'memory_cached', 'memory_available_swap', 'memory_available_real', 'memory_total_swap', 'memory_total_real']
    if ((self.var_id in network_sensors) or (self.var_id in memory_sensors)):
        attr = getattr(self._api.utilisation, self.var_id)(False)
        if (self.var_id in network_sensors):
            return round((attr / 1024.0), 1)
        elif (self.var_id in memory_sensors):
            return round(((attr / 1024.0) / 1024.0), 1)
    else:
        return getattr(self._api.utilisation, self.var_id)
