playactor icon indicating copy to clipboard operation
playactor copied to clipboard

`IDevice#discover()` reuses cache indefinitely; no obvious way to access `IResolvedDevice#resolve()`

Open kopiro opened this issue 3 years ago • 2 comments

Hello Daniel, awesome work on this library.

I'm currently implementing a porting of your library for homebridge, and I have some questions regarding the IDevice interface and the IResolvedDevice; it looks like that calling .discover() on a pre-found device doesn't actually re-discover it, and it doesn't give me up-to-date informations.

I found that there is a .resolve() method that should do exactly this, but I'm not able to get this sub-class fromt he public methods your provide.

Would you be up for a quick chat regarding your TS interfaces?

kopiro avatar Feb 08 '22 14:02 kopiro

I ended up using always Device::withId() to make sure informations were discovered from scratch instead of re-using the IDeviceInformation; https://github.com/kopiro/homebridge-playstation

Not sure if optimal, but it works.

kopiro avatar Feb 09 '22 08:02 kopiro

Ah interesting. Your approach should be effectively the same as a more "obvious" API, but in the meantime I'll reopen this—you make a good point that the API doesn't quite work as expected.

dhleong avatar Feb 09 '22 16:02 dhleong