|
楼主 |
发表于 2024-5-30 18:46:50
|
显示全部楼层
class MercedesMEDeviceTracker(MercedesMeEntity, TrackerEntity, RestoreEntity):
"""Representation of a Sensor."""
@property
def latitude(self) -> Optional[float]:
"""Return latitude value of the device."""
lat = self._get_car_value("location", "positionLat", "value", 0)
lng = self._get_car_value("location", "positionLong", "value", 0)
if self._use_chinese_location_data:
lng, lat = ch.gcj02_to_wgs84(gcj_lon=lng, gcj_lat=lat)
return lat if lat else None
@property
def longitude(self) -> Optional[float]:
"""Return longitude value of the device."""
lat = self._get_car_value("location", "positionLat", "value", 0)
lng = self._get_car_value("location", "positionLong", "value", 0)
if self._use_chinese_location_data:
lng, lat = ch.gcj02_to_wgs84(gcj_lon=lng, gcj_lat=lat)
return lng if lng else None
@property
def source_type(self):
"""Return the source type, eg gps or router, of the device."""
return SourceType.GPS
@property
def device_class(self):
"""Return the device class of the device tracker."""
return None
我看了对应集成的代码,是不是能直接在这个代码上加减固定值来调整经纬度? |
|