Compare commits

..

1 Commits

Author SHA1 Message Date
Li Shuzhen
0d9e670144
Merge 38691d01f5 into a11c3e2fda 2025-10-13 08:27:29 +08:00
2 changed files with 5 additions and 6 deletions

View File

@ -11,7 +11,6 @@
- Ignore unsupported properties of xiaomi.wifispeaker.l15a and 759413.aircondition.iez.
- Add an alongside button entity for xiaomi.wifispeaker.l05b play action.
- Add zhimi.fan.za1 fan mode description in zh_Hans.
- Fix the error reported by pylint-4.0.0. [#1455](https://github.com/XiaoMi/ha_xiaomi_home/pull/1455)
## v0.4.2
### Changed

View File

@ -49,7 +49,7 @@ MIoT redirect web pages.
import os
import asyncio
web_template = ''
_template = ''
def _load_page_template():
@ -57,18 +57,18 @@ def _load_page_template():
os.path.dirname(os.path.abspath(__file__)),
'resource/oauth_redirect_page.html')
with open(path, 'r', encoding='utf-8') as f:
global web_template
web_template = f.read()
global _template
_template = f.read()
async def oauth_redirect_page(
title: str, content: str, button: str, success: bool
) -> str:
"""Return oauth redirect page."""
if web_template == '':
if _template == '':
await asyncio.get_running_loop().run_in_executor(
None, _load_page_template)
web_page = web_template.replace('TITLE_PLACEHOLDER', title)
web_page = _template.replace('TITLE_PLACEHOLDER', title)
web_page = web_page.replace('CONTENT_PLACEHOLDER', content)
web_page = web_page.replace('BUTTON_PLACEHOLDER', button)
web_page = web_page.replace(