eet-energy / solmate-sdk

All you need to integrate your EET SolMate into your home automation system
MIT License
18 stars 1 forks source link

Add local URI capability #4

Closed mmattel closed 9 months ago

mmattel commented 10 months ago

Using LocalSolMateAPIClient instead of SolMateAPIClient, you need to provide an address how to connect to the Solmate locally.

In addition when connecting locally, there is no query if the solmate is online. If you can access the address, it is online by design.

felix-pilgram commented 9 months ago

Thank you for contribution.

Now we can save one line of code to provide the uri in the constructor of the APIClient: client = solmate_sdk.LocalSolMateAPIClient("X2S1K0506A00000001", uri = "ws://192.168.0.138:9124/") replaces

client = solmate_sdk.LocalSolMateAPIClient("X2S1K0506A00000001" )
client.uri = "ws://192.168.0.138:9124/"

The check_online function is only implemented on the sol server. We will probably refactor your code change by moving the local check_online logic to the LocalSolMateAPIClient.