def update(self):
        """Get the latest state of the sensor."""
        data = ecobee.NETWORK
        data.update()
        for sensor in data.ecobee.get_remote_sensors(self.index):
            for item in sensor['capability']:
                if (
                        item['type'] == self.type and
                        self.type == 'temperature' and
                        self.sensor_name == sensor['name']):
                    self._state = float(item['value']) / 10
                elif (
                        item['type'] == self.type and
                        self.type == 'humidity' and
                        self.sensor_name == sensor['name']):
                    self._state = item['value']
                elif (
                        item['type'] == self.type and
                        self.type == 'occupancy' and
                        self.sensor_name == sensor['name']):
                    self._state = item['value']
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/sensor/ecobee.py/EcobeeSensor.update/original