j1nx / homeassistant-phonetrack

PhoneTrack custom device_tracker component for Home Assistant.
Apache License 2.0
30 stars 16 forks source link

Deprecation notice #6

Open jose1711 opened 8 months ago

jose1711 commented 8 months ago

Latest HA reports:

SOURCE_TYPE_GPS was used from phonetrack, this is a deprecated constant which will be removed in HA Core 2025.1. Use
SourceType.GPS instead, please report it to the author of the 'phonetrack' custom integration
c2bull commented 6 months ago

@jose1711 - I noticed the same thing, played with it today.

If you edit the device_tracker.py and change two lines: Line 12 to be "SourceType," Line 112 to be "source_type=GPS,"

jose1711 commented 6 months ago

@c2bull Thank you, however it looks like maintainer lost interest in this project.

c2bull commented 6 months ago

I do agree, but it looks like this easy change should keep it working when the new HA core comes out

tslpre commented 6 months ago

@c2bull - just a little correction:

Line 12 to be "SourceType," Line 112 to be "source_type=SourceType.GPS,"

c2bull commented 6 months ago

When I tried line 112 to be SourceType.GPS it ran into an error on start. Also when I looked at the developer doc at :

https://developers.home-assistant.io/docs/core/entity/device-tracker/

it shows the following (just the word GPS or Router is what you should use as the source_type):

source_type SourceType Required The source type, eg gps or router, of the device.

c2bull commented 6 months ago

I went ahead and created a pull request with the updates that work for me. Hopefully @j1nx will get a look at them before the source type change is required.

dbiczo commented 3 months ago

@c2bull - just a little correction:

Line 12 to be "SourceType," Line 112 to be "source_type=SourceType.GPS,"

Works for me in 2024.6.2

c2bull commented 3 months ago

@j1nx - the above comment by @tslpre is correct, line 123 of the device_tracker.py should be:

source_type=SourceType.GPS,

(while just GPS was working for me a for a while it recently broke, this is the correct fix)

j1nx commented 3 months ago

@c2bull I just merged some open PR's. Does this fix the issue at hand?

Secondly; As stated above. I am currently swamped with development and other tasks related to OpenVoiceOS project and although HomeAssistant integration will also be part of that project together with Nextcloud integration for CalDav, so at some point in time this repo becomes interesting for me again. However, that still takes quite some time and I am more then happy to handover this repository to anyone that wants to take it further.

If anyone is interested in taking over this repository under his account, please feel free to reach out to me.

c2bull commented 3 months ago

Hi @j1nx - I appreciate you coming back to the project and doing the merges. I just created a new pull request that should set the source_type to what HA now requires. Apologies for having to do the re-work.

j1nx commented 3 months ago

All good and no worries.

PR is merged. Thx

chrisaga commented 2 months ago

Hello. I am here because my phonetrack integration suddenly stopped working. I checked line 12 and 123 device_tracker.py both on my Home Assistant and in this repository. Line 123 is OK (source_type=SourceType.GPS). Line 12 is not (SOURCE_TYPE). I corrected line 12 -> SourceType and it's seems OK now for me :+1: So I think this is still to be fixed on this repository.

the01 commented 2 months ago

That should be covert via #10, but as mentioned above, @j1nx is busy so it might take a while to get merged

j1nx commented 2 months ago

Merged, so should be fixed again then.