Recode Home Assistant instance name to ascii for Jellyfin (#87368)

Recode instance name to ascii
This commit is contained in:
Jan Stienstra 2023-03-12 19:31:10 +01:00 committed by GitHub
parent 73cd62bd32
commit 8d88b02c2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,10 +20,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
entry_data[CONF_CLIENT_DEVICE_ID] = entry.entry_id
hass.config_entries.async_update_entry(entry, data=entry_data)
client = create_client(
device_id=entry.data[CONF_CLIENT_DEVICE_ID],
device_name=hass.config.location_name,
)
device_id = entry.data[CONF_CLIENT_DEVICE_ID]
device_name = ascii(hass.config.location_name)
client = create_client(device_id=device_id, device_name=device_name)
try:
user_id, connect_result = await validate_input(hass, dict(entry.data), client)