core: Critical errors when wifi deactivated on freebox component

The problem

I don’t use the builtin wifi capabilities of my freebox so I’m getting those errors that are filling up my logs:

Update for switch.freebox_wifi fails                                                                                                                                                                                                                                                        
Traceback (most recent call last):                                                                                                                                                                                                                                                          
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 272, in async_update_ha_state                                                                                                                                                                                         
    await self.async_device_update()                                                                                                                                                                                                                                                        
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 463, in async_device_update                                                                                                                                                                                           
    await self.async_update()  # type: ignore                                                                                                                                                                                                                                               
  File "/usr/src/homeassistant/homeassistant/components/freebox/switch.py", line 75, in async_update                                                                                                                                                                                        
    datas = await self._router.wifi.get_global_config()                                                                                                                                                                                                                                     
  File "/usr/src/homeassistant/homeassistant/components/freebox/router.py", line 186, in wifi                                                                                                                                                                                               
    return self._api.wifi                                                                                                                                                                                                                                                                   
AttributeError: 'NoneType' object has no attribute 'wifi'

Environment

  • Home Assistant Core release with the issue: 0.113.3
  • Last working Home Assistant Core release (if known): n/a
  • Operating environment (OS/Container/Supervised/Core): Docker
  • Integration causing this issue: freebox
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/freebox/

Problem-relevant configuration.yaml

n/a

Traceback/Error logs

Update for switch.freebox_wifi fails                                                                                                                                                                                                                                                        
Traceback (most recent call last):                                                                                                                                                                                                                                                          
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 272, in async_update_ha_state                                                                                                                                                                                         
    await self.async_device_update()                                                                                                                                                                                                                                                        
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 463, in async_device_update                                                                                                                                                                                           
    await self.async_update()  # type: ignore                                                                                                                                                                                                                                               
  File "/usr/src/homeassistant/homeassistant/components/freebox/switch.py", line 75, in async_update                                                                                                                                                                                        
    datas = await self._router.wifi.get_global_config()                                                                                                                                                                                                                                     
  File "/usr/src/homeassistant/homeassistant/components/freebox/router.py", line 186, in wifi                                                                                                                                                                                               
    return self._api.wifi                                                                                                                                                                                                                                                                   
AttributeError: 'NoneType' object has no attribute 'wifi'

Additional information

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 17 (11 by maintainers)

Most upvoted comments

Could not reproduce the error.

  • With Wi-Fi disabled i have no errors.
  • Tried to shutdown Wi-Fi and reboot HA while Wi-Fi off still no error.
  • Last thing i must try is to setup a new HA and associate Freebox with Wi-Fi disabled. Maybe the error comes from setting up integration with Wi-Fi disabled. => Will try and report ASAP !

@os131 Disabling a platform from an integration is a good point but not sure if doable… Would need an expert/core dev answer ! You can still disable all entities from the device tracker of the Freebox integration and disable new entities auto add for the Freebox integration.

Edit : @Quentame the error with call logs is there when there’s no calls in the call log of the Freebox (tested & reproduced !) Will open another issue !)

Opened : #39863