File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -326,7 +326,7 @@ def defaults(self) -> dict:
326326 'running' : False ,
327327 'dark_mode' : False ,
328328 'mode' : Modes .MANUAL .value ,
329- 'coordinates' : (0 , 0 ),
329+ 'coordinates' : (0.0 , 0. 0 ),
330330 'update_location' : False ,
331331 'update_interval' : 60 ,
332332 'times' : ('07:00' , '20:00' ),
Original file line number Diff line number Diff line change @@ -51,9 +51,14 @@ def get_qt_position() -> QGeoCoordinate:
5151
5252def get_ipinfo_position () -> QGeoCoordinate :
5353 # use the old method as a fallback
54- response = requests .get ('https://www.ipinfo.io/loc' )
54+ try :
55+ response = requests .get ('https://www.ipinfo.io/loc' )
56+ except Exception as e :
57+ logger .error (e )
58+ raise TypeError ('Error while sending a request to get location' )
59+
5560 if not response .ok :
56- logger . error ('Failed to get location from ipinfo.io' )
61+ raise TypeError ('Failed to get location from ipinfo.io' )
5762
5863 loc_response = response .text .removesuffix ('\n ' ).split (',' )
5964 loc : [float ] = [float (coordinate ) for coordinate in loc_response ]
You can’t perform that action at this time.
0 commit comments