diff --git a/README.md b/README.md index 9877076..9745abe 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,10 @@ +# fin-assistant +--- +fin-assistant is the revival of jellyfin-ha to bring the ability for voice assist to jellyfin. + + + + # jellyfin_ha Jellyfin integration for Home Assistant diff --git a/custom_components/jellyfin/__init__.py b/custom_components/jellyfin/__init__.py index 0c0f01f..45a2cef 100644 --- a/custom_components/jellyfin/__init__.py +++ b/custom_components/jellyfin/__init__.py @@ -195,6 +195,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry): hass.data[DOMAIN][config.get(CONF_URL)][platform] = {} hass.data[DOMAIN][config.get(CONF_URL)][platform]["entities"] = [] + if hasattr(hass.config_entries, "async_forward_entry_setups"): await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS) else: @@ -203,6 +204,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry): hass.config_entries.async_forward_entry_setup(config_entry, platform) ) + async_dispatcher_send(hass, SIGNAL_STATE_UPDATED) async def stop_jellyfin(event): @@ -216,6 +218,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry): async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry): _LOGGER.info("Unloading jellyfin") + if hasattr(hass.config_entries, "async_unload_platforms"): unload_ok = await hass.config_entries.async_unload_platforms( config_entry, PLATFORMS @@ -227,6 +230,7 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry): config_entry, platform ) + _jelly: JellyfinClientManager = hass.data[DOMAIN][config_entry.data.get(CONF_URL)]["manager"] await _jelly.stop() diff --git a/custom_components/jellyfin/config_flow.py b/custom_components/jellyfin/config_flow.py index 0c83108..d6f9b20 100644 --- a/custom_components/jellyfin/config_flow.py +++ b/custom_components/jellyfin/config_flow.py @@ -28,21 +28,22 @@ RESULT_CONN_ERROR = "cannot_connect" RESULT_LOG_MESSAGE = {RESULT_CONN_ERROR: "Connection error"} -@config_entries.HANDLERS.register(DOMAIN) -class JellyfinFlowHandler(config_entries.ConfigFlow): + +class JellyfinFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): """Config flow for Jellyfin component.""" + VERSION = 1 CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_PUSH @staticmethod @callback def async_get_options_flow(config_entry): - """Jellyfin options callback.""" + """Return the options flow handler.""" return JellyfinOptionsFlowHandler(config_entry) def __init__(self): - """Init JellyfinFlowHandler.""" + """Initialize the config flow.""" self._errors = {} self._url = None self._ssl = DEFAULT_SSL diff --git a/custom_components/jellyfin/manifest.json b/custom_components/jellyfin/manifest.json index b5113d1..29c00be 100644 --- a/custom_components/jellyfin/manifest.json +++ b/custom_components/jellyfin/manifest.json @@ -1,11 +1,11 @@ { - "domain": "jellyfin", - "name": "Jellyfin", - "version": "1.1.2", + "domain": "Jellyfin", + "name": "fin-assistant", + "version": "0.0.1", "config_flow": true, - "documentation": "https://github.com/koying/jellyfin_ha", - "issue_tracker": "https://github.com/koying/jellyfin_ha/issues", + "documentation": "https://github.com/sudoxnym/fin-assistant", + "issue_tracker": "https://github.com/sudoxnym/fin-assistant/issues", "requirements": ["jellyfin-apiclient-python==1.7.2"], - "codeowners": ["@koying"], + "codeowners": ["sudoxnym"], "iot_class": "local_push" }