Skip to content

Commit

Permalink
Fix MQTT (#281)
Browse files Browse the repository at this point in the history
* fix mqtt

* fix tests

---------

Co-authored-by: Tomas Prvak <[email protected]>
  • Loading branch information
prvakt and Tomas Prvak authored Dec 12, 2024
1 parent b4916e0 commit e36d41e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion myskoda/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import logging
import re
import ssl
import uuid
from collections.abc import Awaitable, Callable
from datetime import UTC, datetime
from random import uniform
Expand Down Expand Up @@ -148,7 +149,8 @@ async def _connect_and_listen(self) -> None:
async with aiomqtt.Client(
hostname=self.hostname,
port=self.port,
username=self.user_id,
username="android-app", # Explicit username from working payload
identifier=str(uuid.uuid4()), # Dynamically generate a UUID-based client ID
password=await self.authorization.get_access_token(),
logger=_LOGGER,
tls_context=_SSL_CONTEXT if self.enable_ssl else None,
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/mqtt/mqtt_auth.passwd
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
b8bc126c-ee36-402b-8723-2c1c3dff8dec:$6$MGqm5bvxnRGdkOcb$pBFJr/xRkkYlFpm22IWT.136XJvr86S5z1lj2lK6fiNGzj1H61PLeSXaNdWe9CX/ccsOsRexxvd2ymSqwRQti.
android-app:$6$MGqm5bvxnRGdkOcb$pBFJr/xRkkYlFpm22IWT.136XJvr86S5z1lj2lK6fiNGzj1H61PLeSXaNdWe9CX/ccsOsRexxvd2ymSqwRQti.
admin:$6$m8bNssXjMHgGHYMa$qzfmgSGo1FQQ6uFWTw.WkvSbR2ZlWJaEvsGVyBsFcPe2RsM51tG5v3YTiLZ7FK9qRHpO2SvEOHmC6BV8K0hn31

0 comments on commit e36d41e

Please sign in to comment.