File tree Expand file tree Collapse file tree 5 files changed +26
-26
lines changed
esp32s3_s2_tft_featherwing_480x320 Expand file tree Collapse file tree 5 files changed +26
-26
lines changed Original file line number Diff line number Diff line change @@ -88,14 +88,14 @@ def _convert_locations_for_small_screen(self):
88
88
_y_ratio = 240 / 320
89
89
# 46x
90
90
print (_x_ratio , _y_ratio )
91
- for loc_key in self .LOCATIONS .keys ():
92
- if isinstance (self . LOCATIONS [ loc_key ] , tuple ):
93
- _x , _y = self . LOCATIONS [ loc_key ]
94
- self .LOCATIONS [loc_key ] = (int (_x * _x_ratio ), int (_y * _y_ratio ))
95
- elif isinstance (self . LOCATIONS [ loc_key ] , list ):
96
- for i in range (len (self . LOCATIONS [ loc_key ] )):
97
- _x , _y = self . LOCATIONS [ loc_key ] [i ]
98
- self .LOCATIONS [loc_key ][i ] = (int (_x * _x_ratio ), int (_y * _y_ratio ))
91
+ for key , value in self .LOCATIONS .items ():
92
+ if isinstance (value , tuple ):
93
+ _x , _y = value
94
+ self .LOCATIONS [key ] = (int (_x * _x_ratio ), int (_y * _y_ratio ))
95
+ elif isinstance (value , list ):
96
+ for i in range (len (value )):
97
+ _x , _y = value [i ]
98
+ self .LOCATIONS [key ][i ] = (int (_x * _x_ratio ), int (_y * _y_ratio ))
99
99
100
100
101
101
@staticmethod
Original file line number Diff line number Diff line change 16
16
from adafruit_esp32spi import adafruit_esp32spi
17
17
import adafruit_touchscreen
18
18
import adafruit_requests
19
- from adafruit_io .adafruit_io import IO_HTTP , AdafruitIO_RequestError
19
+ from adafruit_io .adafruit_io import IO_HTTP
20
20
21
21
from spirit_board import SpiritBoard
22
22
Original file line number Diff line number Diff line change @@ -88,14 +88,14 @@ def _convert_locations_for_small_screen(self):
88
88
_y_ratio = 240 / 320
89
89
# 46x
90
90
print (_x_ratio , _y_ratio )
91
- for loc_key in self .LOCATIONS .keys ():
92
- if isinstance (self . LOCATIONS [ loc_key ] , tuple ):
93
- _x , _y = self . LOCATIONS [ loc_key ]
94
- self .LOCATIONS [loc_key ] = (int (_x * _x_ratio ), int (_y * _y_ratio ))
95
- elif isinstance (self . LOCATIONS [ loc_key ] , list ):
96
- for i in range (len (self . LOCATIONS [ loc_key ] )):
97
- _x , _y = self . LOCATIONS [ loc_key ] [i ]
98
- self .LOCATIONS [loc_key ][i ] = (int (_x * _x_ratio ), int (_y * _y_ratio ))
91
+ for key , value in self .LOCATIONS .items ():
92
+ if isinstance (value , tuple ):
93
+ _x , _y = value
94
+ self .LOCATIONS [key ] = (int (_x * _x_ratio ), int (_y * _y_ratio ))
95
+ elif isinstance (value , list ):
96
+ for i in range (len (value )):
97
+ _x , _y = value [i ]
98
+ self .LOCATIONS [key ][i ] = (int (_x * _x_ratio ), int (_y * _y_ratio ))
99
99
100
100
101
101
@staticmethod
Original file line number Diff line number Diff line change 16
16
from adafruit_esp32spi import adafruit_esp32spi
17
17
import adafruit_touchscreen
18
18
import adafruit_requests
19
- from adafruit_io .adafruit_io import IO_HTTP , AdafruitIO_RequestError
19
+ from adafruit_io .adafruit_io import IO_HTTP
20
20
21
21
from spirit_board import SpiritBoard
22
22
Original file line number Diff line number Diff line change @@ -88,14 +88,14 @@ def _convert_locations_for_small_screen(self):
88
88
_y_ratio = 240 / 320
89
89
# 46x
90
90
print (_x_ratio , _y_ratio )
91
- for loc_key in self .LOCATIONS .keys ():
92
- if isinstance (self . LOCATIONS [ loc_key ] , tuple ):
93
- _x , _y = self . LOCATIONS [ loc_key ]
94
- self .LOCATIONS [loc_key ] = (int (_x * _x_ratio ), int (_y * _y_ratio ))
95
- elif isinstance (self . LOCATIONS [ loc_key ] , list ):
96
- for i in range (len (self . LOCATIONS [ loc_key ] )):
97
- _x , _y = self . LOCATIONS [ loc_key ] [i ]
98
- self .LOCATIONS [loc_key ][i ] = (int (_x * _x_ratio ), int (_y * _y_ratio ))
91
+ for key , value in self .LOCATIONS .items ():
92
+ if isinstance (value , tuple ):
93
+ _x , _y = value
94
+ self .LOCATIONS [key ] = (int (_x * _x_ratio ), int (_y * _y_ratio ))
95
+ elif isinstance (value , list ):
96
+ for i in range (len (value )):
97
+ _x , _y = value [i ]
98
+ self .LOCATIONS [key ][i ] = (int (_x * _x_ratio ), int (_y * _y_ratio ))
99
99
100
100
101
101
@staticmethod
You can’t perform that action at this time.
0 commit comments