Save RAM and improve volume changes
Save RAM by optimising imports and reducing class usage Change volume by 8% each time, using saved volume value and only one query. Minimum volume is 1% and max is 100%. Queries are not run if decreasing volume from 1% or increasing from 100%
This commit is contained in:
8
utils.py
8
utils.py
@@ -1,5 +1,3 @@
|
||||
class Utils:
|
||||
# method from Tony Goodhew 21st April 2022, for thepihut.com
|
||||
@staticmethod
|
||||
def colour(R,G,B): # Convert RGB888 to RGB565
|
||||
return (((G&0b00011100)<<3) +((B&0b11111000)>>3)<<8) + (R&0b11111000)+((G&0b11100000)>>5)
|
||||
# method from Tony Goodhew 21st April 2022, for thepihut.com
|
||||
def colour(R,G,B): # Convert RGB888 to RGB565
|
||||
return (((G&0b00011100)<<3) +((B&0b11111000)>>3)<<8) + (R&0b11111000)+((G&0b11100000)>>5)
|
||||
Reference in New Issue
Block a user