perf: cloud mqtt broker host constant value (#1530)
Some checks failed
Tests / check-rule-format (push) Failing after 1s
Validate / validate-hassfest (push) Failing after 0s
Validate / validate-hacs (push) Failing after 10s
Validate / validate-lint (push) Failing after -1s
Validate / validate-setup (push) Failing after 2s

This commit is contained in:
Li Shuzhen
2025-12-04 12:19:21 +08:00
committed by GitHub
parent d5c5e387c2
commit 30ce1b4970
16 changed files with 43 additions and 34 deletions

View File

@@ -68,7 +68,11 @@ from paho.mqtt.client import (
# pylint: disable=relative-beyond-top-level
from .common import MIoTMatcher
from .const import UNSUPPORTED_MODELS, MIHOME_MQTT_KEEPALIVE
from .const import (
UNSUPPORTED_MODELS,
MIHOME_MQTT_KEEPALIVE,
DEFAULT_CLOUD_BROKER_HOST
)
from .miot_error import MIoTErrorCode, MIoTMipsError
_LOGGER = logging.getLogger(__name__)
@@ -858,7 +862,8 @@ class MipsCloudClient(_MipsClient):
) -> None:
self._msg_matcher = MIoTMatcher()
super().__init__(
client_id=f'ha.{uuid}', host=f'{cloud_server}-ha.mqtt.io.mi.com',
client_id=f'ha.{uuid}',
host=f'{cloud_server}-{DEFAULT_CLOUD_BROKER_HOST}',
port=port, username=app_id, password=token, loop=loop)
@final