public function getDevices($type = DEVICE_TYPE_THERMOSTAT) {
        $this->prepareForGet();
        if ($type == DEVICE_TYPE_PROTECT) {
            $protects = array();
            $topaz = isset($this->last_status->topaz) ? $this->last_status->topaz : array();
            foreach ($topaz as $protect) {
                $protects[] = $protect->serial_number;
            }
            return $protects;
        }
        $devices_serials = array();
        foreach ($this->last_status->user->{$this->userid}->structures as $structure) {
            list(, $structure_id) = explode('.', $structure);
            foreach ($this->last_status->structure->{$structure_id}->devices as $device) {
                list(, $device_serial) = explode('.', $device);
                $devices_serials[] = $device_serial;
            }
        }
        return $devices_serials;
    }