Custom Component: HACS

Installed my first theme with HACS.
The docs say you should use themes: !include_dir_named themes, but then the config check raises errors.

Invalid config for [frontend]: value should be a string for dictionary value @ data['frontend']['themes']

If i edit the theme file and comment out the theme key, it works.

#  slate:
    # Main colors
    primary-color: '#2980b9'

Other way would be to use themes: !include_dir_merge_named themes and leave the theme file as it is.

So which way to go?

@ludeeus I have this error sometimes in log:

2019-07-22 18:11:59 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/custom_components/hacs/hacsbase/__init__.py", line 279, in recuring_tasks_installed
    await repository.update()
  File "/home/homeassistant/.homeassistant/custom_components/hacs/repositories/hacsrepositoryintegration.py", line 42, in update
    if await self.common_update():
  File "/home/homeassistant/.homeassistant/custom_components/hacs/repositories/hacsrepositorybase.py", line 178, in common_update
    await self.set_additional_info()
  File "/home/homeassistant/.homeassistant/custom_components/hacs/repositories/hacsrepositorybase.py", line 404, in set_additional_info
    info = await self.repository.get_contents(file.name, self.ref)
  File "/srv/homeassistant/lib/python3.7/site-packages/backoff/_async.py", line 131, in retry
    ret = await target(*args, **kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/hacs/aiogithub/aiogithubrepository.py", line 80, in get_contents
    if response.get("message"):
AttributeError: 'NoneType' object has no attribute 'get'

Is that a reason to worry?

Please make a PR to change the docs.

No, you get that when GitHub returns a empty response (server error), it’s handled in next

1 Like

I restarted my hass.io today. Since this time hacs is not working anymore

2019-07-28 00:12:22 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/hacs/hacsbase/__init__.py", line 56, in startup_tasks
    self.store.task_running = True
AttributeError: 'NoneType' object has no attribute 'task_running'
2019-07-28 00:12:47 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.hacs fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 378, in async_device_update
    await self.async_update()
  File "/config/custom_components/hacs/sensor.py", line 23, in async_update
    if hacs.store.task_running:
AttributeError: 'NoneType' object has no attribute 'task_running'
2019-07-28 00:12:47 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 33, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 67, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 216, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 115, in handle
    result = await result
  File "/config/custom_components/hacs/http.py", line 47, in get
    response = await response.response(self)
  File "/config/custom_components/hacs/http.py", line 118, in response
    render = self.render('settings', message=message)
  File "/config/custom_components/hacs/http.py", line 62, in render
    return template.render({"hacs": self, "location": location, "repository": repository, "message": message})
  File "/usr/local/lib/python3.7/site-packages/jinja2/asyncsupport.py", line 76, in render
    return original_render(self, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.7/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "/config/custom_components/hacs/frontend/templates/settings.html", line 1, in top-level template code
    {% extends "base.html" %}
  File "/config/custom_components/hacs/frontend/templates/base.html", line 47, in top-level template code
    {% block content %}
  File "/config/custom_components/hacs/frontend/templates/settings.html", line 11, in block "content"
    {% include 'settings/hacs_info.html' with context %}
  File "/config/custom_components/hacs/frontend/templates/settings/hacs_info.html", line 1, in top-level template code
    {% if hacs.store.repositories["172733314"].pending_restart %}
  File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 411, in getitem
    return obj[argument]
jinja2.exceptions.UndefinedError: 'None' has no attribute 'repositories'
2019-07-28 00:13:17 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.hacs fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 378, in async_device_update
    await self.async_update()
  File "/config/custom_components/hacs/sensor.py", line 23, in async_update
    if hacs.store.task_running:
AttributeError: 'NoneType' object has no attribute 'task_running'

Is anyone using HACS with a fire tablet running Fully Kiosk Browser? It appears those plugins are not displaying correctly.

Looks like most add-on that are modules don’t work properly on the Fire Tablets.
Luckly for me, mine is the new 8 version so I just put a custom ROM and it and it works perfectly.

Are you taking about Lovelace plugins? If they are not running properly that is nothing to do with HACS. Hacs is just an installer.

I had it working a month or two ago when I initially tried to setup fully kiosk but now it’s giving me errors. I’m not sure which change is causing it to fail now but it’s only the plugins that are failing.

Which plugins? Failing how? Got any logs?

V 0.13 will drop in a week (or two) (it require HA 0.97+ and that will not be published for another week)
It will include an (almost) complete rewrite of the backend, and I think I will publish it as a pre-release (Beta) for a few days/week before a full launch.
Currently, you can not see beta of HACS inside HACS, but “upgrading” to beta will be “simple” and “documented”.

I now have 2 questions, are anyone interested in testing a beta version when that is ready (probably tomorrow or the day after) (you would need to run HA beta)?

  • Yes
  • No

0 voters

During the beta there will most likely be issues/questions, is GitHub good enough, or should I create a Discord server for that purpose?

  • Github is good enough
  • Create Discord server

0 voters

I’d normally say yes to beta testing but I am flat out with real life at the moment sorry.

1 Like

Count me in @ludeeus

1 Like

Me 2 @ludeeus

For integration developers:
Starting next version (0.13) if you add config_flow support to your integration, HACS will reload the internal CC cache in HA, so your users can install and configure your integration without restarting Home Assistant :smiley:

Demo:

16 Likes

For those that wanted to test out 0.13, I now published a prerelease here https://github.com/custom-components/hacs/releases/tag/0.13.0b0

Installed beta version, no issues so far.
Setup HACS using config_flow - easy as
Nice work

1 Like

A quick question, is this still the ‘right’ way to do this?
And do you know why I have hacs, hacs.1 and hacs.2 in my storage folder?

hi,

I installed HACS successfully and looks great!
Now I have Alexa Media player custom component already installed: what happen if I do install it with HACS?
is it simply overwritten?

I played with beta 0.13 a bit. I installed the components, removed, upgraded and there were no issues so far. Everything works perfectly.

This feature is sweet :slight_smile:

1 Like

is there a way to configure HACS to ignore updates tagged with beta or pre-release?