mirror of
				https://github.com/python-kasa/python-kasa.git
				synced 2025-10-31 04:31:54 +00:00 
			
		
		
		
	Do not crash on missing geolocation (#701)
If 'has_set_location_info' is false, the geolocation is missing.
This commit is contained in:
		| @@ -147,8 +147,8 @@ class TapoDevice(SmartDevice): | ||||
|     def location(self) -> Dict: | ||||
|         """Return the device location.""" | ||||
|         loc = { | ||||
|             "latitude": cast(float, self._info.get("latitude")) / 10_000, | ||||
|             "longitude": cast(float, self._info.get("longitude")) / 10_000, | ||||
|             "latitude": cast(float, self._info.get("latitude", 0)) / 10_000, | ||||
|             "longitude": cast(float, self._info.get("longitude", 0)) / 10_000, | ||||
|         } | ||||
|         return loc | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Teemu R
					Teemu R