TECH7Fox / asterisk-hass-integration

Asterisk integration for Home Assistant
60 stars 14 forks source link

Doesnt copy file when resources are in yaml method #3

Closed pergolafabio closed 2 years ago

pergolafabio commented 2 years ago

disocvered this bug, i think its because i use resources in yaml and not UI mode, if i add it manuallu it works

2021-12-15 11:23:56 WARNING (MainThread) [custom_components.asterisk] [Errno 17] File exists: '/config/www'
2021-12-15 11:23:56 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.0.75 for asterisk
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 313, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/asterisk/init.py", line 142, in async_setup_entry
    await resources.async_create_item({'res_type': 'module', 'url': '/asterisk/sipjs-card.js'})
AttributeError: 'ResourceYAMLCollection' object has no attribute 'async_create_item'
2021-12-15 11:24:19 ERROR (stream_worker) [homeassistant.components.stream] Error from stream worker: Stream ended; no additional packets
TECH7Fox commented 2 years ago

Should be fixed in this commit: https://github.com/TECH7Fox/Asterisk-integration/commit/25a33a336342d471a5c267c6d174f0737b33e8a8

It won't add the resource, but it now gives a warning and doesn't crash the entire integration.

pergolafabio commented 2 years ago

confirmed, no error, only these warnings for now


2021-12-19 13:57:36 WARNING (MainThread) [custom_components.asterisk] [Errno 17] File exists: '/config/www'
2021-12-19 13:57:36 WARNING (MainThread) [custom_components.asterisk] [Errno 17] File exists: '/config/www/asterisk'