deblockt / google-home-push

python lib to push message on google case device
MIT License
15 stars 8 forks source link

socket.gethostbyname(socket.gethostname()) can return 127.0.0.1 #4

Closed JohnGe closed 3 years ago

JohnGe commented 4 years ago

Hello,

Thank you very much for this lib.

There is a small issue with the local server in the way it delivers TTS files created with googlecloudTTS_builder https://github.com/deblockt/google-home-push/blob/517ebf8df84dda70abddda735ab88941b213e66d/googlehomepush/http_server.py#L68

It can return 127.0.0.1 and not the LAN adress.

One way to do it could be to use this solution from stackoverflow: https://stackoverflow.com/questions/166506/finding-local-ip-addresses-using-pythons-stdlib/28950776#28950776

Anyway, thank you very much for the great work.

thevickypedia commented 3 years ago

raised a PR for this