public function device($idenOrNickname)
    {
        if ($this->devices === null) {
            $this->getDevices();
        }

        foreach ($this->devices as $d) {
            if ($d->iden == $idenOrNickname || $d->nickname == $idenOrNickname) {
                return $d;
            }
        }

        throw new Exceptions\NotFoundException("Device not found.");
    }