kodi-pvr / pvr.hdhomerun

Kodi's HDHomeRun client addon
GNU General Public License v2.0
20 stars 24 forks source link

Allow user to set specific IP of hdhomerun unit #144

Open fuzzard opened 1 year ago

fuzzard commented 1 year ago

Im away from home and had a need to watch tv from my hdhomeruns located at home. Im connected via a vpn, so the "normal" discovery methods dont work. no broadcast searches, and the HTTP discovery API doesnt return anything as the WAN IP doesnt match the WAN ip of the actual hdhomerun units.

The libhdhomerun api makes it so we can quite easily provide a specific IP for the search to look at for a device (and all the associated tuner info).

All ive added is a setting to enter an address, we than supply that address to a search. This will only work for ipv4 addresses. Ive made no attempt at supporting ipv6 (who uses ipv6 on LANs?). This also doesnt support multiple units, just a single one unlike the normal search methods. This might be something to add later, but i think this use case isnt going to be common, and realistically we should probably look at the multiple provider stuff in Kodi now for multiple tuners.

Tested functional on x86_64 macos running Nexus RC2

fuzzard commented 1 year ago

Have added help labels for the two discovery related options. Have also put them into their own group.

Added some other comments in the strings.po (usage of labels/category/etc) inline with what pvr.iptvsimple has had. It looked like it might be useful, although we only have a handful of settings in this addon.

My only other question is about the capability to restart an addon on setting change. Is there a setting xml attribute that will do this, or does it need to be handled in the addon code? I see iptvsimple does an addon read in its process() function, but i think this might be a bit overkill for this addon, since it would be a set once (or rarely) and dont change type of setting, so not sure if polling continuously for settings changes is worth it. For now ive added a comment in the help label to say to restart the addon. Let me know what you think is the best way to handle it.

phunkyfish commented 1 year ago

How you have done it is correct.