nest.class.php
public function getUserLocations() {
        $this->prepareForGet();
        $structures = (array) $this->last_status->structure;
        $user_structures = array();
        $class_name = get_class($this);
        $topaz = isset($this->last_status->topaz) ? $this->last_status->topaz : array();
        foreach ($structures as $struct_id => $structure) {
            // Nest Protects at this location (structure)
            $protects = array();
            foreach ($topaz as $protect) {
                if ($protect->structure_id == $struct_id) {
                    $protects[] = $protect->serial_number;
                }
            }

            $weather_data = $this->getWeather($structure->postal_code, $structure->country_code);
            $user_structures[] = (object) array(
                'name' => isset($structure->name)?$structure->name:'',
                'address' => !empty($structure->street_address) ? $structure->street_address : NULL,
                'city' => $structure->location,
                'postal_code' => $structure->postal_code,
                'country' => $structure->country_code,
                'outside_temperature' => $weather_data->outside_temperature,
                'outside_humidity' => $weather_data->outside_humidity,
                'away' => $structure->away,
                'away_last_changed' => date(DATETIME_FORMAT, $structure->away_timestamp),
                'thermostats' => array_map(array($class_name, 'cleanDevices'), $structure->devices),
                'protects' => $protects,
            );
        }
        return $user_structures;
    }
public function getUserLocations() {
        $this->prepareForGet();
        $structures = (array) $this->last_status->structure;
        $user_structures = array();
        $class_name = get_class($this);
        $topaz = isset($this->last_status->topaz) ? $this->last_status->topaz : array();
        foreach ($structures as $struct_id => $structure) {
            // Nest Protects at this location (structure)
            $protects = array();
            foreach ($topaz as $protect) {
                if ($protect->structure_id == $struct_id) {
                    $protects[] = $protect->serial_number;
                }
            }

            $weather_data = $this->getWeather($structure->postal_code, $structure->country_code);
            $user_structures[] = (object) array(
                'name' => isset($structure->name)?$structure->name:'',
                'address' => !empty($structure->street_address) ? $structure->street_address : NULL,
                'city' => $structure->location,
                'postal_code' => $structure->postal_code,
                'country' => $structure->country_code,
                'outside_temperature' => $weather_data->outside_temperature,
                'outside_humidity' => $weather_data->outside_humidity,
                'away' => $structure->away,
                'away_last_changed' => date(DATETIME_FORMAT, $structure->away_timestamp),
                'thermostats' => array_map(array($class_name, 'cleanDevices'), $structure->devices),
                'protects' => $protects,
            );
        }
        return $user_structures;
    }
Get a list of all the locations configured in the Nest account.

@return array