scottyphillips / mitsubishi_echonet

A Python library for interfacing with Mitsubishi HVAC with Echonet lite over WiFi
MIT License
25 stars 13 forks source link

Specifying network interface in mit.discover() #20

Open purederp opened 2 years ago

purederp commented 2 years ago

Hola, https://github.com/purederp/mitsubishi_echonet/compare/12b8ded..dd55d6a

I've made a small modification so that I can tell my pi to look for devices on its wifi network, and not the default-routed eth0 network.

Putting this as a comment rather than a pull request, since you may want some changes first, and other users may have comments about pitfalls, or upsides of methodolgy that I'm unaware of. (Also, I'm unfamiliar with github)

This modification of mine only works (well, has been tested) on linux. I dunno if there is a sensible equivalent for windows/if I need to support other platforms with any feature addition.

Let me know if you'd prefer to modify .discover() to take an interfaces's ip address (or, network_address/subnet), or, just iterate scanning over all RFC1918-address-ranged-interfaces And if the added functionality needs to work on windows/etc (I can do windows in a VM. I can hope that mac is unixy enough that Linux-targeted changes work for it)