'Parse data sent by gateway.'

def parse_data(self, data):

    value = data.get(self._data_key)
    if (value is None):
        return False
    value = float(value)
    if ((self._data_key == 'temperature') and (value == 10000)):
        return False
    elif ((self._data_key == 'humidity') and (value == 0)):
        return False
    elif ((self._data_key == 'illumination') and (value == 0)):
        return False
    elif ((self._data_key == 'pressure') and (value == 0)):
        return False
    if (self._data_key in ['temperature', 'humidity', 'pressure']):
        value /= 100
    elif (self._data_key in ['illumination']):
        value = max((value - 300), 0)
    self._state = round(value, 2)
    return True
