Mobile app: Drop descriptive emoji name support (#67120)
parent
c243247e35
commit
3380a15bbb
|
@ -4,10 +4,8 @@ from __future__ import annotations
|
|||
from contextlib import suppress
|
||||
from http import HTTPStatus
|
||||
import secrets
|
||||
from typing import cast
|
||||
|
||||
from aiohttp.web import Request, Response
|
||||
import emoji
|
||||
from nacl.secret import SecretBox
|
||||
import voluptuous as vol
|
||||
|
||||
|
@ -82,18 +80,8 @@ class RegistrationsView(HomeAssistantView):
|
|||
|
||||
data[CONF_USER_ID] = request["hass_user"].id
|
||||
|
||||
if slugify(data[ATTR_DEVICE_NAME], separator=""):
|
||||
# if slug is not empty and would not only be underscores
|
||||
# use DEVICE_NAME
|
||||
pass
|
||||
elif emoji.emoji_count(data[ATTR_DEVICE_NAME]):
|
||||
# If otherwise empty string contains emoji
|
||||
# use descriptive name of the first emoji
|
||||
data[ATTR_DEVICE_NAME] = emoji.demojize(
|
||||
cast(str, emoji.emoji_lis(data[ATTR_DEVICE_NAME])[0]["emoji"])
|
||||
).replace(":", "")
|
||||
else:
|
||||
# Fallback to DEVICE_ID
|
||||
# Fallback to DEVICE_ID if slug is empty.
|
||||
if not slugify(data[ATTR_DEVICE_NAME], separator=""):
|
||||
data[ATTR_DEVICE_NAME] = data[ATTR_DEVICE_ID]
|
||||
|
||||
await hass.async_create_task(
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
"name": "Mobile App",
|
||||
"config_flow": true,
|
||||
"documentation": "https://www.home-assistant.io/integrations/mobile_app",
|
||||
"requirements": ["PyNaCl==1.4.0", "emoji==1.6.3"],
|
||||
"requirements": ["PyNaCl==1.4.0"],
|
||||
"dependencies": ["http", "webhook", "person", "tag", "websocket_api"],
|
||||
"after_dependencies": ["cloud", "camera", "notify"],
|
||||
"codeowners": ["@home-assistant/core"],
|
||||
"quality_scale": "internal",
|
||||
"iot_class": "local_push",
|
||||
"loggers": ["emoji", "nacl"]
|
||||
"loggers": ["nacl"]
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ bcrypt==3.1.7
|
|||
certifi>=2021.5.30
|
||||
ciso8601==2.2.0
|
||||
cryptography==35.0.0
|
||||
emoji==1.6.3
|
||||
hass-nabucasa==0.53.1
|
||||
home-assistant-frontend==20220222.0
|
||||
httpx==0.21.3
|
||||
|
|
|
@ -608,9 +608,6 @@ elkm1-lib==1.2.0
|
|||
# homeassistant.components.elmax
|
||||
elmax_api==0.0.2
|
||||
|
||||
# homeassistant.components.mobile_app
|
||||
emoji==1.6.3
|
||||
|
||||
# homeassistant.components.emulated_roku
|
||||
emulated_roku==0.2.1
|
||||
|
||||
|
|
|
@ -400,9 +400,6 @@ elkm1-lib==1.2.0
|
|||
# homeassistant.components.elmax
|
||||
elmax_api==0.0.2
|
||||
|
||||
# homeassistant.components.mobile_app
|
||||
emoji==1.6.3
|
||||
|
||||
# homeassistant.components.emulated_roku
|
||||
emulated_roku==0.2.1
|
||||
|
||||
|
|
Loading…
Reference in New Issue