mill1000 / midea-msmart

Python library for local control of Midea (and associated brands) smart air conditioners.
MIT License
49 stars 2 forks source link

Control Support for CLI #96

Closed MarcelMertens closed 2 months ago

MarcelMertens commented 11 months ago

Hi, any chance to add control support for the CLI tool? Currently only discover and query is possible but not control the device via CLI.

Kind Regards

mill1000 commented 10 months ago

I've put a little thought into this. The primary problem to solve it how to get the desired control inputs from the command line.

I think having options for every possible control would be difficult to maintain so I'm leaning towards parsing a string of key-value pairs.

The syntax could be a simple custom format of key=value e.g.

msmart-ng control <DEVICE_IP> power=True fan_speed=100 target_temperature=25

Or the format could be a more complex but readily parsable format via literal_eval or maybe JSON

msmart-ng control <DEVICE_IP> {'power' : True, 'fan_speed' : 100, 'target_temperature' : 25}
MarcelMertens commented 10 months ago

thank you for your feedback. in the meanwhile i build my own FastAPI server based on you libraries.

niklas85 commented 3 months ago

Is there any progress for the device control by cli commands?

mill1000 commented 3 months ago

Unfortunately no. I have not dedicated any time to this. I always welcome PRs though.

At this time I think the cleanest UX would be to support key=value pairs on the command line.

mill1000 commented 3 months ago

Just pushed a PR #132 to implement this. Still hammering out some of the quirks but it should be usable.