Create random sensor data

@param int $passes

@return Sensors
766303
public static function createRandom($passes = 1) : self
    {
        for($i = 0; $i < $passes; $i++) {
            $sensor = new self(
                Random::randomFloat(-0.3, 0.3),
                Random::randomFloat(-0.2, 2.5),
                Random::randomFloat(-0.2, 5),
                Random::randomFloat(0.08, 0.20),
                Random::randomFloat(0.45, 0.62),
                Random::randomFloat(9, 12),
                Random::randomFloat(40, 50),
                Random::randomFloat(-3, 3),
                Random::randomFloat(-125, -85),
                0,
                0,
                0
            );
        }

        return $sensor;
    }
821572
public function updateOne(string $gateSlug, bool $pass) : array {
        return $this->sendPatch(
            sprintf('/profiles/%s/gates/%s', $this->userName, $gateSlug),
            [],
            [
                'pass'     => $pass
            ]
        );
    }
286749
public static function factory($params = [])
    {
        $required = ['base_url', 'client_id', 'client_secret', 'token_uri', 'refresh_token'];

        $config = Collection::fromConfig($params, [], $required);
        $config->set('curl.options', [CURLOPT_PROXY => getenv('HTTPS_PROXY'), CURLOPT_TIMEOUT => 30]);

        $client = new self($config->get('base_url'), $config);

        // The refresh grant type needs its own client
        $refreshClient    = new Http\Client($config->get('token_uri'), $config);
        $refreshGrantType = new Oauth2\GrantType\RefreshToken($refreshClient, $config->toArray());

        // add refresh strategy
        $client->addSubscriber(new Oauth2\Oauth2Plugin($refreshGrantType));

        return $client;
    }
1299845
public static function createFromArray(array $values)
    {
        $cloud = new self(
            $values['domain'],
            $values['port'],
            $values['path'],
            $values['registerProcedure'],
            $values['protocol']
        );

        return $cloud;
    }
311848
public static function create($paths)
    {
        $backends = array(
            new Backend\Inotifywait($paths),
            new Backend\Fswatch($paths),
            new Backend\Watchmedo($paths),
            new Backend\Inotify($paths),
            new Backend\Poll($paths),
        );
        foreach ($backends as $b) {
            if ($b->isAvailable()) {
                $backend = $b;
                break;
            }
        }
        return $backend;
    }
1189044
public function create($args)
    {
        $data = null;
        if (is_object($args)) {
            if ($args instanceof DataItem) {
                $data = $args;
            } else {
                $args = get_object_vars($args);
            }
        } elseif (is_numeric($args)) {
            $args = array($this->getUniqueId() => intval($args));
        }
        return $data ? $data : new DataItem($args, $this->getUniqueId());
    }
1042433
public function create($data = [])
    {
        // Create a random hash
        $hash = $this->hash();

        // Store the file in the tokens storage
        $data = array_merge($data, ['token' => $hash, 'timestamp' => time()]);
        $stored = file_put_contents($this->path($hash), json_encode($data));

        // Return the data or false in case of failure
        return ($stored)? $data : false;
    }
274803
protected function makePasswordGrant()
    {
        $grant = new PasswordGrant(
            $this->app->make(Bridge\UserRepository::class),
            $this->app->make(Bridge\RefreshTokenRepository::class)
        );

        $grant->setRefreshTokenTTL(Passport::refreshTokensExpireIn());

        return $grant;
    }
542821
public static function create($url, $user = null, $pass = null)
    {
        $client = new Client([
            'headers' => [
                'User-Agent' => static::getDefaultUserAgent(),
            ],
        ]);

        $conn = new Connection([
            'url' => $url,
            'user' => $user,
            'pass' => $pass,
        ]);

        $transport = new static($conn);
        $transport->setClient($client);

        return $transport;
    }
897493
private static function transferParams($params): array
    {
        $newParams = [];
        foreach ($params as $key => $value) {
            list($nkey, $nvalue) = EntityHelper::transferParameter($key, $value, null);
            $newParams[$nkey] = $nvalue;
        }

        return $newParams;
    }
579896
public static function createFromValues(array $values)
    {
        if (\array_key_exists('keys', $values) && \is_array($values['keys'])) {
            return JWKSet::createFromKeyData($values);
        }

        return JWK::create($values);
    }
362603
public static function all($params, $opts = null)
    {
        $list = parent::all($params, $opts);
        $ntList = new NotificationCollection();
        $ntList->install($list->values, $list->opts);
        return $ntList;
    }
726287
public function create(array $elements, array $parameters = [])
    {
        $this->validateParameters($parameters);
        $factory = new ListCollectionFactory();
        $list = $factory->create(
            $elements,
            (isset($parameters['headers'])) ? $parameters['headers'] : [],
            (isset($parameters['uuid'])) ? $parameters['uuid'] : null,
            (isset($parameters['element-uuid'])) ? $parameters['element-uuid'] : null
        );

        return $this->repository->create(
            $list,
            (isset($parameters['ttl'])) ? $parameters['ttl'] : null,
            (isset($parameters['chunk-size'])) ? $parameters['chunk-size'] : null
        );
    }
721073
private function createFromData($data)
    {
        $model = $this->dispense()->hydrate($data);
        $model->isNew = false;
        return $model;
    }
1201165
public static function create($headers)
    {
        $result = new self();
        $result->_requestId = Utilities::tryGetValue(
            $headers,
            Resources::X_MS_REQUEST_ID
        );

        return $result;
    }
304088
public function create($params)
    {
        $client = new Client;
        $client->fill($params);
        $client->save();

        // update datacite_symbol
        $this->generateDataciteSymbol($client);

        return $client;
    }
602858
protected function createParametersBody(array $parameters)
    {
        foreach ($parameters as $name => $parameter) {
            if (is_bool($parameter)) {
                $parameters[$name] = $parameter ? 'true' : 'false';
            } elseif (is_array($parameter)) {
                foreach ($parameter as $subName => $subParameter) {
                    if (is_bool($subParameter)) {
                        $subParameter = $subParameter ? 'true' : 'false';
                    }
                    $parameters[$name.'/'.$subName] = $subParameter;
                }
                unset($parameters[$name]);
            } elseif ($parameter instanceof DateTime) {
                $parameters[$name] = $parameter->format($parameter::ATOM);
            }
        }

        return $parameters;
    }