kubawolanin / ha-openhab

WORK IN PROGRESS 🏠 openHAB custom integration for Home Assistant
MIT License
15 stars 5 forks source link

SOURCE_TYPE_GPS is deprecated #26

Open kovacsla opened 6 months ago

kovacsla commented 6 months ago

Home assistant shows warning message in the log (presumably since 2024.1.0):

2024-01-07 03:27:34.818 WARNING (MainThread) [homeassistant.components.device_tracker] SOURCE_TYPE_GPS was used from openhab, this is a deprecated constant which will be removed in HA Core 2025.1. Use SourceType.GPS instead, please create a bug report at https://github.com/kubawolanin/ha-openhab/issues

I'am not a develpper. I think the next two row change are fixing the problem.

file name: device_tracker.py

2 from homeassistant.components.device_tracker import SOURCE_TYPE_GPS 63 return SOURCE_TYPE_GPS

change to

2 from homeassistant.components.device_tracker import SourceType.GPS 63 SourceType.GPS

I think this modify only works after the HA 2025.1 update. Please, someone confirm me about this solution wheter it's working or not!