新增高德逆地理编码地址实体#7
Open
shigella520 wants to merge 1 commit into
Open
Conversation
新增可选的高德 Web 服务 API Key 配置项,并为每辆 Ninebot 车辆创建地址 sensor。 Ninebot 返回的车辆坐标保留为 WGS-84,用于 Home Assistant 的 GPS 定位;调用高德逆地理编码前转换为 GCJ-02,避免国内地图地址偏移。 地址查询增加 50 米缓存,车辆位置变化较小时复用上一次地址,减少高德 API 请求次数。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动
formatted_address,属性保留省市区、街道、adcode、原始坐标和高德坐标。原因
新版九号接口只返回经纬度,旧版可直接显示的路名地址不再来自
device_tracker。这个 PR 用可选高德 API Key 补回具体地址实体,并保持不填写 key 时的原行为。验证
python3 -m py_compile custom_components/ninebot/*.pyjq . custom_components/ninebot/translations/zh-Hans.jsonjq . custom_components/ninebot/translations/en.jsongit diff --check