nbogojevic / midea-beautiful-air

Python client for accessing Midea air conditioners and dehumidifiers (Midea, Comfee, Inventor EVO) via local network
MIT License
109 stars 18 forks source link

How to run an on off example in the code? #33

Closed vldmr-d closed 1 month ago

vldmr-d commented 3 months ago

`from midea_beautiful import appliance_state from midea_beautiful.appliance import Appliance, AirConditionerAppliance from midea_beautiful.command import MideaCommand from midea_beautiful.exceptions import MideaError from typing import Any, Sequence, cast

from midea_beautiful.command import ( AirConditionerResponse, AirConditionerSetCommand, DehumidifierResponse, DehumidifierSetCommand, DeviceCapabilitiesCommand, DeviceCapabilitiesCommandMore, MideaSequenceCommand, )

appliance = appliance_state( address="", # APPLIANCE_IP_ADDRESS token="", # TOKEN obtained from Midea API key="", # Token KEY obtained from Midea API )

print(f"{appliance!r}")

print(appliance.state)

state = cast(AirConditionerAppliance, appliance.state) print(f" running = {state.running}") print(f" indoor = {state.indoor_temperature}") print(f" outdoor = {state.outdoor_temperature}")

print(state)

` Output

running = True indoor = 31.0 outdoor = 29.0

I am not strong in coding. I was able to get just the temperature I needed. But how to run the code to turn on and off the air conditioner? ( send --running 1 in code)?

vldmr-d commented 3 months ago

I still can't turn device on and off via Python code

vldmr-d commented 3 months ago

It's already resolved appliance.set_state(running=True)

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.