WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Ivan-Alone/GyverLamp-PHP-API

Repository files navigation

GyverLamp-PHP-API

GyverLamp PHP Controller. Can be used in fully remote lamp control from Internet, or in other

Documentation

All documentation written in PHPDoc in each class file.

Example

<?php

	include 'GyverLamp.class.php';
	include 'LampModes.class.php';
	
	// Connectiong to GyverLamp on 192.168.1.125:8888
	$lamp = new GyverLamp('192.168.1.125', 8888);
	
	if ($lamp->isConnected()) {
		// Power off lamp
		$lamp->setPower(false);
	
		// Select Fire mode
		$lamp->setMode(LampModes::byName('Fire'));
		// Set full brightness
		$lamp->setBrightness(255);
		// Set 25/255 effect speed
		$lamp->setSpeed(25);
		// Set 0 effect scale
		$lamp->setScale(0);
	
		// Toggle power, enabling lamp
		$lamp->togglePower();
	
		// Print current lamp info
		print_r($lamp->getInfo());
	} else {
		echo 'Error: can\'t connect to GyverLamp!'.PHP_EOL;
	}

About

GyverLamp PHP Controller. Can be used in fully remote lamp control from Internet, or in other

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages