Skip to content

Commit

Permalink
Merge pull request #221 from heldchen/patch-5
Browse files Browse the repository at this point in the history
Realign accsmart.panasonic.com headers with v1.21.0
  • Loading branch information
sockless-coding authored Jun 26, 2024
2 parents 997224a + cd897a3 commit fab9aa7
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ async def get(settings: PanasonicSettings, app_version: CCAppVersion, include_cl
now = datetime.datetime.now()
timestamp = now.strftime("%Y-%m-%d %H:%M:%S")
headers={
"Content-Type": "application/json;charset=utf-8",
"User-Agent": "G-RAC",
"X-APP-NAME": "Comfort Cloud",
"X-APP-TIMESTAMP": timestamp,
"X-APP-TYPE": "1",
"X-APP-VERSION": await app_version.get(),
"X-CFC-API-KEY": PanasonicRequestHeader._get_api_key(),
"X-User-Authorization-V2": "Bearer " + settings.access_token
"content-type": "application/json;charset=utf-8",
"user-agent": "G-RAC",
"x-app-name": "Comfort Cloud",
"x-app-timestamp": timestamp,
"x-app-type": "1",
"x-app-version": await app_version.get(),
"x-cfc-api-key": PanasonicRequestHeader._get_api_key(),
"x-user-authorization-v2": "Bearer " + settings.access_token
}
if (include_client_id and settings.clientId):
headers["X-Client-Id"] = settings.clientId
headers["x-client-id"] = settings.clientId
return headers

@staticmethod
def _get_api_key():
return ''.join(random.choice(string.hexdigits) for _ in range(128))
return ''.join(random.choice(string.hexdigits) for _ in range(128))

0 comments on commit fab9aa7

Please sign in to comment.