Sanderhuisman / home-assistant-custom-components

🏡 Custom components for Home-Assistant
https://www.home-assistant.io/
Apache License 2.0
33 stars 12 forks source link

Error about network even with no network monitored conditions set up #22

Open guillaumelamirand opened 4 years ago

guillaumelamirand commented 4 years ago

Hello

I set up your custom component with the following settings :

docker_monitor:
  name: "Monitoring: Docker Monitor"
  scan_interval: 30
  containers:
    - xxxxx
    - xxxxx
    - xxxxx
  monitored_conditions:
    - container_status
    - container_uptime
    - container_cpu_percentage_usage

As you can see, I didn't set up any network conditions but I have the following error in my log

2020-05-19 10:29:00 INFO (Thread-6) [custom_components.docker_monitor] Cannot grab NET usage for container xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx('networks').

I don't know the root cause of the error but even if it was working, the component should query network info only if there is monitored_conditions about network. What do you think?

Thanks

guillaumelamirand commented 4 years ago

I figure it out that container with network=host doesn't have attribute network in stats API.