mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Let Blinkstick accept upper case colours
This commit is contained in:
		| @@ -23,7 +23,8 @@ | |||||||
| </script> | </script> | ||||||
|  |  | ||||||
| <script type="text/x-red" data-help-name="blinkstick"> | <script type="text/x-red" data-help-name="blinkstick"> | ||||||
| 	<p>BlinkStick output node. Expects a <b>msg.payload</b> with either a hex string #rrggbb triple or red,green,blue as three 0-255 values.</p> |     <p>BlinkStick output node. Expects a <b>msg.payload</b> with either a hex string #rrggbb triple or red,green,blue as three 0-255 values. | ||||||
|  |     It can also accept <i><a href="http://www.w3schools.com/html/html_colornames.asp" target="_new">standard HTML colour</a></i> names</p> | ||||||
|     <p><b>NOTE:</b> currently only works with a single BlinkStick. (As it uses the findFirst() function to attach).</p> |     <p><b>NOTE:</b> currently only works with a single BlinkStick. (As it uses the findFirst() function to attach).</p> | ||||||
|     <p>For more info see the <i><a href="http://blinkstick.com/" target="_new">BlinkStick website</a></i> or the <i><a href="https://github.com/arvydas/blinkstick-node" target="_new">node module</a></i> documentation.</p> |     <p>For more info see the <i><a href="http://blinkstick.com/" target="_new">BlinkStick website</a></i> or the <i><a href="https://github.com/arvydas/blinkstick-node" target="_new">node module</a></i> documentation.</p> | ||||||
| </script> | </script> | ||||||
|   | |||||||
| @@ -39,7 +39,7 @@ function BlinkStick(n) { | |||||||
|                         node.led.setColor(parseInt(rgb[0])&255, parseInt(rgb[1])&255, parseInt(rgb[2])&255); |                         node.led.setColor(parseInt(rgb[0])&255, parseInt(rgb[1])&255, parseInt(rgb[2])&255); | ||||||
|                     } |                     } | ||||||
|                     else { |                     else { | ||||||
| 						node.led.setColor(msg.payload); |                         node.led.setColor(msg.payload.toLowerCase().replace(/\s+/g,'')); | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|                 catch (err) { |                 catch (err) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user