mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2026-01-19 08:50:42 +08:00
Compare commits
3 Commits
38691d01f5
...
d59e454c95
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d59e454c95 | ||
|
|
900ed0a221 | ||
|
|
fbddaf80a7 |
@ -11,6 +11,7 @@
|
|||||||
- Ignore unsupported properties of xiaomi.wifispeaker.l15a and 759413.aircondition.iez.
|
- Ignore unsupported properties of xiaomi.wifispeaker.l15a and 759413.aircondition.iez.
|
||||||
- Add an alongside button entity for xiaomi.wifispeaker.l05b play action.
|
- Add an alongside button entity for xiaomi.wifispeaker.l05b play action.
|
||||||
- Add zhimi.fan.za1 fan mode description in zh_Hans.
|
- 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
|
## v0.4.2
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
@ -49,7 +49,7 @@ MIoT redirect web pages.
|
|||||||
import os
|
import os
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
_template = ''
|
web_template = ''
|
||||||
|
|
||||||
|
|
||||||
def _load_page_template():
|
def _load_page_template():
|
||||||
@ -57,18 +57,18 @@ def _load_page_template():
|
|||||||
os.path.dirname(os.path.abspath(__file__)),
|
os.path.dirname(os.path.abspath(__file__)),
|
||||||
'resource/oauth_redirect_page.html')
|
'resource/oauth_redirect_page.html')
|
||||||
with open(path, 'r', encoding='utf-8') as f:
|
with open(path, 'r', encoding='utf-8') as f:
|
||||||
global _template
|
global web_template
|
||||||
_template = f.read()
|
web_template = f.read()
|
||||||
|
|
||||||
|
|
||||||
async def oauth_redirect_page(
|
async def oauth_redirect_page(
|
||||||
title: str, content: str, button: str, success: bool
|
title: str, content: str, button: str, success: bool
|
||||||
) -> str:
|
) -> str:
|
||||||
"""Return oauth redirect page."""
|
"""Return oauth redirect page."""
|
||||||
if _template == '':
|
if web_template == '':
|
||||||
await asyncio.get_running_loop().run_in_executor(
|
await asyncio.get_running_loop().run_in_executor(
|
||||||
None, _load_page_template)
|
None, _load_page_template)
|
||||||
web_page = _template.replace('TITLE_PLACEHOLDER', title)
|
web_page = web_template.replace('TITLE_PLACEHOLDER', title)
|
||||||
web_page = web_page.replace('CONTENT_PLACEHOLDER', content)
|
web_page = web_page.replace('CONTENT_PLACEHOLDER', content)
|
||||||
web_page = web_page.replace('BUTTON_PLACEHOLDER', button)
|
web_page = web_page.replace('BUTTON_PLACEHOLDER', button)
|
||||||
web_page = web_page.replace(
|
web_page = web_page.replace(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user