'Initialize the min/max sensor.'

def __init__(self, hass, entity_ids, name, sensor_type, round_digits):

    self._hass = hass
    self._entity_ids = entity_ids
    self._sensor_type = sensor_type
    self._round_digits = round_digits
    if name:
        self._name = name
    else:
        self._name = '{}    sensor'.format(next((v for (k, v) in SENSOR_TYPES.items() if (self._sensor_type == v)))).capitalize()
    self._unit_of_measurement = None
    self._unit_of_measurement_mismatch = False
    self.min_value = self.max_value = self.mean = STATE_UNKNOWN
    self.count_sensors = len(self._entity_ids)
    self.states = {}
    @callback
    def async_min_max_sensor_state_listener(entity, old_state, new_state):
        'Handle    the    sensor    state    changes.'
        if ((new_state.state is None) or (new_state.state in STATE_UNKNOWN)):
            self.states[entity] = STATE_UNKNOWN
            hass.async_add_job(self.async_update_ha_state, True)
            return
        if (self._unit_of_measurement is None):
            self._unit_of_measurement = new_state.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
        if (self._unit_of_measurement != new_state.attributes.get(ATTR_UNIT_OF_MEASUREMENT)):
            _LOGGER.warning('Units    of    measurement    do    not    match    for    entity    %s', self.entity_id)
            self._unit_of_measurement_mismatch = True
        try:
            self.states[entity] = float(new_state.state)
        except ValueError:
            _LOGGER.warning('Unable    to    store    state.    Only    numerical    states    are    supported')
        hass.async_add_job(self.async_update_ha_state, True)
    async_track_state_change(hass, entity_ids, async_min_max_sensor_state_listener)
