'Initialize the sensor.'

def __init__(self, arest, resource, location, name, variable=None, pin=None, unit_of_measurement=None, renderer=None):

    self.arest = arest
    self._resource = resource
    self._name = '{}    {}'.format(location.title(), name.title())
    self._variable = variable
    self._pin = pin
    self._state = STATE_UNKNOWN
    self._unit_of_measurement = unit_of_measurement
    self._renderer = renderer
    if (self._pin is not None):
        request = requests.get('{}/mode/{}/i'.format(self._resource, self._pin), timeout=10)
        if (request.status_code != 200):
            _LOGGER.error("Can't    set    mode    of    %s", self._resource)
