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:
2024-05-16 22:55:51 +01:00
parent 0c4cbfcbb1
commit ae8e42d68f
6 changed files with 214 additions and 231 deletions

View File

@@ -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)