mirror of
				https://github.com/hyperion-project/hyperion.ng.git
				synced 2025-03-01 10:33:28 +00:00 
			
		
		
		
	Update JsonClientConnection.cpp
JSON API: Get current LED color Former-commit-id: 0b40c1eb1627afd8077bdf690109609fd531c2fb
This commit is contained in:
		@@ -528,6 +528,21 @@ void JsonClientConnection::handleServerInfoCommand(const Json::Value &)
 | 
			
		||||
 | 
			
		||||
		activeEffects.append(activeEffect);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	// collect active led colors
 | 
			
		||||
	Json::Value & activeLedColors = info["activeLedColors"] = Json::Value(Json::arrayValue);
 | 
			
		||||
	foreach (int priority, activePriorities) {
 | 
			
		||||
		const Hyperion::InputInfo & priorityInfo = _hyperion->getPriorityInfo(priority);
 | 
			
		||||
 		int i=0;
 | 
			
		||||
		Json::Value LEDcolor;
 | 
			
		||||
		for (auto it = priorityInfo.ledColors.begin(); it!=priorityInfo.ledColors.end(); ++it, ++i) {		    
 | 
			
		||||
			LEDcolor[std::to_string(i)].append(it->red);
 | 
			
		||||
			LEDcolor[std::to_string(i)].append(it->green);
 | 
			
		||||
			LEDcolor[std::to_string(i)].append(it->blue);		    
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		activeLedColors.append(LEDcolor);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// send the result
 | 
			
		||||
	sendMessage(result);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user