ensure list is right length
This commit is contained in:
		
							parent
							
								
									6ee892d23b
								
							
						
					
					
						commit
						42ab015458
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		|  | @ -25,6 +25,9 @@ class LightStrip: | |||
|   def get_next_pattern_tick(self): | ||||
|     n = self.np.n | ||||
|     t = self.cur_tick | ||||
|     if not len(self.cur_pattern) >= n - 1: | ||||
|       li = [(255, 255, 255)] * (n - len(self.cur_pattern)) | ||||
|       self.cur_pattern.extend(li) | ||||
|     for i in range(n): | ||||
|       self.cur_pattern[i] = self.pattern(i, t) | ||||
|     self.cur_tick = t + 1 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue