'Return a new state based on the type.
If the sensor type is unknown, the current state is returned.'

def get_state(self, data):

    lookup_type = convert_to_camel(self.type)
    state = getattr(data, lookup_type, None)
    if (state is None):
        return state
    if ('summary' in self.type):
        self._icon = getattr(data, 'icon', '')
    if (self.type in ['precip_probability', 'cloud_cover', 'humidity']):
        return round((state * 100), 1)
    elif (self.type in ['dew_point', 'temperature', 'apparent_temperature', 'temperature_min', 'temperature_max', 'apparent_temperature_min', 'apparent_temperature_max', 'pressure', 'ozone']):
        return round(state, 1)
    return state
