Skip to content

Commit

Permalink
Add missing deviceID to API requests. (#17)
Browse files Browse the repository at this point in the history
The API recently started requiring this. Close #16, and close mac-zhou/midea-ac-py#217
  • Loading branch information
mill1000 committed Aug 3, 2023
1 parent e5b44b1 commit 9d81243
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions msmart/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class cloud:
LANGUAGE = 'en_US'
APP_ID = "1010"
SRC = "1010"
DEVICE_ID = "c1acad8939ac0d7d"

def __init__(self, email, password, use_china_server=False):
# Get this from any of the Midea based apps, you can find one on Yitsushi's github page
Expand Down Expand Up @@ -76,6 +77,7 @@ def api_request(self, endpoint, args=None, data=None):
'language': self.LANGUAGE,
'src': self.SRC,
'stamp': datetime.now().strftime("%Y%m%d%H%M%S"),
'deviceId': self.DEVICE_ID,
}
# Add the method parameters for the endpoint
data.update(args)
Expand Down

0 comments on commit 9d81243

Please sign in to comment.