Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontier silicon integration (AFSAPI) raises exception when radio is not plugged in #28102

Closed
Deadolus opened this issue Oct 22, 2019 · 1 comment

Comments

@Deadolus
Copy link

Home Assistant release with the issue:
0.100.2

Last working Home Assistant release (if known):
NONE

Operating environment (Hass.io/Docker/Windows/etc.):
Docker via hassio_install.sh

Integration:
https://www.home-assistant.io/integrations/frontier_silicon/

Description of problem:
The Frontier Silicon integration does not seem to take in to account that a radio could be powered off and off the network.
The connection times out and a error is raised endlessly in a loop (see below).
The integration should handle the timeout in the connection and set the state of previously found devices as "unavailable" or similar (not "off").

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

media_player:
  - platform: frontier_silicon
    host: 192.168.1.5
    password: 1234

Traceback (if applicable):

2019-10-22 07:59:42 INFO (MainThread) [root] AFSAPI Exception: Traceback (most recent call last):                                                                                                                  
  File "/usr/local/lib/python3.7/site-packages/afsapi/__init__.py", line 101, in call                                                                                                                              
    self.__webfsapi = yield from self.get_fsapi_endpoint()                                                                                                                                                         
  File "/usr/local/lib/python3.7/site-packages/afsapi/__init__.py", line 81, in get_fsapi_endpoint                                                                                                                 
    endpoint = yield from self.__session.get(self.fsapi_device_url, timeout = self.timeout)                                                                                                                        
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 582, in _request                                                                                                                           
    break                                                                                                                                                                                                          
  File "/usr/local/lib/python3.7/site-packages/aiohttp/helpers.py", line 586, in __exit__                                                                                                                          
    raise asyncio.TimeoutError from None                                                                                                                                                                           
concurrent.futures._base.TimeoutError                                                                                                                                                                              
                                                                                                                                                                                                                   
2019-10-22 07:59:50 INFO (MainThread) [root] AFSAPI Exception: Traceback (most recent call last):                                                                                                                  
  File "/usr/local/lib/python3.7/site-packages/afsapi/__init__.py", line 101, in call                                                                                                                              
    self.__webfsapi = yield from self.get_fsapi_endpoint()                                                                                                                                                         
  File "/usr/local/lib/python3.7/site-packages/afsapi/__init__.py", line 81, in get_fsapi_endpoint                                                                                                                 
    endpoint = yield from self.__session.get(self.fsapi_device_url, timeout = self.timeout)                                                                                                                        
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 582, in _request                                                                                                                           
    break                                                                                                                                                                                                          
  File "/usr/local/lib/python3.7/site-packages/aiohttp/helpers.py", line 586, in __exit__                                                                                                                          
    raise asyncio.TimeoutError from None                                                                                                                                                                           
concurrent.futures._base.TimeoutError  
2019-10-22 07:59:52 INFO (MainThread) [root] AFSAPI Exception: Traceback (most recent call last):                                                                                                                  
  File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 936, in _wrap_create_connection                                                                                                         
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore  # noqa                                                                                                                             
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 954, in create_connection                                                                                                                           
    raise exceptions[0]                                                                                                                                                                                            
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 941, in create_connection                                                                                                                           
    await self.sock_connect(sock, address)                                                                                                                                                                         
  File "/usr/local/lib/python3.7/asyncio/selector_events.py", line 464, in sock_connect                                                                                                                            
    return await fut                                                                                                                                                                                               
  File "/usr/local/lib/python3.7/asyncio/selector_events.py", line 494, in _sock_connect_cb                                                                                                                        
    raise OSError(err, f'Connect call failed {address}')                                                                                                                                                           
OSError: [Errno 113] Connect call failed ('192.168.1.5', 80)                                                                                                                                                       
                                                                                                                                                                                                                   
The above exception was the direct cause of the following exception:                                                                                                                                               
                                                                                                                                                                                                                   
Traceback (most recent call last):                                                                                                                                                                                 
  File "/usr/local/lib/python3.7/site-packages/afsapi/__init__.py", line 101, in call                                                                                                                              
    self.__webfsapi = yield from self.get_fsapi_endpoint()                                                                                                                                                         
  File "/usr/local/lib/python3.7/site-packages/afsapi/__init__.py", line 81, in get_fsapi_endpoint                                                                                                                 
    endpoint = yield from self.__session.get(self.fsapi_device_url, timeout = self.timeout)                                                                                                                        
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 483, in _request                                                                                                                           
    timeout=real_timeout                                                                                                                                                                                           
  File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 523, in connect                                                                                                                         
    proto = await self._create_connection(req, traces, timeout)                                                                                                                                                    
  File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 859, in _create_connection                                                                                                              
    req, traces, timeout)                                                                                                                                                                                          
  File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 1004, in _create_direct_connection                                                                                                      
    raise last_exc                                                                                                                                                                                                 
  File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 986, in _create_direct_connection                                                                                                       
    req=req, client_error=client_error)                                                                                                                                                                            
  File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 943, in _wrap_create_connection                                                                                                         
    raise client_error(req.connection_key, exc) from exc                                                                                                                                                           
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.1.5:80 ssl:None [Connect call failed ('192.168.1.5', 80)]                                                                           
                                                                                                                                                

Additional information:
Background: I have my radio on a physical on/off electricity switch - it is usually off if no one is in the kitchen.
If the switch is on and the radio connected to the internet the integration works as expected.
I found the error by "docker attach" to the running homeassistant container.

@stale
Copy link

stale bot commented Jan 20, 2020

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 20, 2020
@stale stale bot closed this as completed Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants