mirror of
				https://github.com/hyperion-project/hyperion.ng.git
				synced 2025-03-01 10:33:28 +00:00 
			
		
		
		
	Removed rate limiting from code. Setting framegrabbing frequency of 10 Hz / number of lights is sufficient.
Former-commit-id: 0686a8d18c780038eb017fdf26b5faf4b8053f3a
This commit is contained in:
		@@ -18,11 +18,6 @@ LedDevicePhilipsHue::~LedDevicePhilipsHue() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int LedDevicePhilipsHue::write(const std::vector<ColorRgb> & ledValues) {
 | 
					int LedDevicePhilipsHue::write(const std::vector<ColorRgb> & ledValues) {
 | 
				
			||||||
	// Due to rate limiting (max. 30 request per seconds), discard new values if
 | 
					 | 
				
			||||||
	// the previous request have not been completed yet.
 | 
					 | 
				
			||||||
	if (http->hasPendingRequests()) {
 | 
					 | 
				
			||||||
		return -1;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	unsigned int lightId = 1;
 | 
						unsigned int lightId = 1;
 | 
				
			||||||
	for (const ColorRgb& color : ledValues) {
 | 
						for (const ColorRgb& color : ledValues) {
 | 
				
			||||||
		float x, y, b;
 | 
							float x, y, b;
 | 
				
			||||||
@@ -50,8 +45,6 @@ void LedDevicePhilipsHue::put(QString route, QString content) {
 | 
				
			|||||||
	header.setValue("Content-Length", QString("%1").arg(content.size()));
 | 
						header.setValue("Content-Length", QString("%1").arg(content.size()));
 | 
				
			||||||
	http->setHost(host);
 | 
						http->setHost(host);
 | 
				
			||||||
	http->request(header, content.toAscii());
 | 
						http->request(header, content.toAscii());
 | 
				
			||||||
	// std::cout << "LedDevicePhilipsHue::put(): " << header.toString().toUtf8().constData() << std::endl;
 | 
					 | 
				
			||||||
	// std::cout << "LedDevicePhilipsHue::put(): " << content.toUtf8().constData() << std::endl;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
QString LedDevicePhilipsHue::getRoute(unsigned int lightId) {
 | 
					QString LedDevicePhilipsHue::getRoute(unsigned int lightId) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,7 +15,7 @@
 | 
				
			|||||||
 * 
 | 
					 * 
 | 
				
			||||||
 * To use set the device to "philipshue".
 | 
					 * To use set the device to "philipshue".
 | 
				
			||||||
 * Uses the official Philips Hue API (http://developers.meethue.com).
 | 
					 * Uses the official Philips Hue API (http://developers.meethue.com).
 | 
				
			||||||
 * Framegrabber should be limited to 30 Hz / numer of lights to avoid rate limitation by the hue bridge.
 | 
					 * Framegrabber must be limited to 10 Hz / numer of lights to avoid rate limitation by the hue bridge.
 | 
				
			||||||
 * Create a new API user name "newdeveloper" on the bridge (http://developers.meethue.com/gettingstarted.html)
 | 
					 * Create a new API user name "newdeveloper" on the bridge (http://developers.meethue.com/gettingstarted.html)
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
class LedDevicePhilipsHue : public LedDevice
 | 
					class LedDevicePhilipsHue : public LedDevice
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user