ha-bambulab icon indicating copy to clipboard operation
ha-bambulab copied to clipboard

[Bug] Warning on blocking call to load_default_certs

Open SixFive7 opened this issue 5 months ago • 1 comments

Describe the bug

Version v2.0.22 on home assistant 2024.9.0 is giving me the following warning on load:

2024-09-06 14:49:22.792 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to load_default_certs with args (<ssl.SSLContext object at 0x1511ad256350>,) inside the event loop by custom integration 'bambu_lab' at custom_components/bambu_lab/pybambu/bambu_client.py, line 332: self.client.tls_set(tls_version=ssl.PROTOCOL_TLS, cert_reqs=ssl.CERT_NONE) (offender: /usr/local/lib/python3.12/site-packages/paho/mqtt/client.py, line 806: context.load_default_certs()), please create a bug report at https://github.com/greghesp/ha-bambulab/issues
File "/config/custom_components/bambu_lab/coordinator.py", line 131, in listen
File "/config/custom_components/bambu_lab/pybambu/bambu_client.py", line 332, in connect

To Reproduce

Install home assistant core. Add HACS. Add this integration. Watch the ha container logs.

Expected Behaviour

No warning.

What device are you using?

X1C

Diagnostic Output

Collapsed
{
  "home_assistant": {
    "installation_type": "Home Assistant Container",
    "version": "2024.9.0",
    "dev": false,
    "hassio": false,
    "virtualenv": false,
    "python_version": "3.12.4",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Amsterdam",
    "os_name": "Linux",
    "os_version": "6.1.106-Unraid",
    "run_as_root": true
  },
  "custom_components": {
    "extended_openai_conversation": {
      "documentation": "https://github.com/jekalmin/extended_openai_conversation",
      "version": "1.0.3",
      "requirements": [
        "openai~=1.3.8"
      ]
    },
    "chime_tts": {
      "documentation": "https://nimroddolev.github.io/chime_tts",
      "version": "v1.1.4-beta4",
      "requirements": [
        "pydub"
      ]
    },
    "hacs": {
      "documentation": "https://hacs.xyz/docs/configuration/start",
      "version": "2.0.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "elevenlabs_tts": {
      "documentation": "https://github.com/carleeno/elevenlabs_tts",
      "version": "2.4.0",
      "requirements": []
    },
    "bambu_lab": {
      "documentation": "https://github.com/greghesp/ha-bambulab",
      "version": "2.0.22",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "bambu_lab",
    "name": "Bambu Lab",
    "codeowners": [
      "greghesp",
      "AdrianGarside"
    ],
    "config_flow": true,
    "dependencies": [
      "device_automation",
      "ffmpeg",
      "mqtt"
    ],
    "documentation": "https://github.com/greghesp/ha-bambulab",
    "iot_class": "local_push",
    "issue_tracker": "https://github.com/greghesp/ha-bambulab/issues",
    "ssdp": [
      {
        "st": "urn:bambulab-com:device:3dprinter:1"
      }
    ],
    "version": "2.0.22",
    "is_built_in": false
  },
  "setup_times": {
    "null": {
      "setup": 2.4810899049043655e-05
    },
    "01J58KT0JQAQ5RSYMP133863TZ": {
      "wait_import_platforms": -0.012971838936209679,
      "wait_base_component": -0.0005275089060887694,
      "config_entry_setup": 0.025125637068413198
    }
  },
  "data": {
    "config_entry": {
      "created_at": "2024-08-14T14:13:58.487508+00:00",
      "data": {
        "device_type": "X1C",
        "serial": "**REDACTED**"
      },
      "disabled_by": null,
      "domain": "bambu_lab",
      "entry_id": "01J58KT0JQAQ5RSYMP133863TZ",
      "minor_version": 1,
      "modified_at": "2024-09-06T09:47:48.147098+00:00",
      "options": {
        "region": "Europe",
        "email": "**REDACTED**",
        "username": "**REDACTED**",
        "name": "Bambu 1",
        "host": "",
        "local_mqtt": false,
        "auth_token": "**REDACTED**",
        "access_code": "**REDACTED**",
        "usage_hours": 2.9800000000000004
      },
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "title": "**REDACTED**",
      "unique_id": null,
      "version": 2
    },
    "push_all": {
      "ams": {
        "ams": [],
        "ams_exist_bits": "0",
        "ams_exist_bits_raw": "0",
        "insert_flag": true,
        "power_on_flag": false,
        "tray_exist_bits": "0",
        "tray_is_bbl_bits": "0",
        "tray_now": "254",
        "tray_pre": "254",
        "tray_read_done_bits": "0",
        "tray_reading_bits": "0",
        "tray_tar": "254",
        "version": 2
      },
      "ams_rfid_status": 2,
      "ams_status": 1280,
      "aux_part_fan": true,
      "bed_target_temper": 35.0,
      "bed_temper": 36.0,
      "big_fan1_speed": "10",
      "big_fan2_speed": "0",
      "cali_version": 0,
      "chamber_temper": 35.0,
      "command": "push_status",
      "cooling_fan_speed": "15",
      "ctt": 0,
      "device": {
        "fan": 65290,
        "nozzle": {
          "0": {
            "info": 136,
            "temp": 14418140
          },
          "info": 105
        }
      },
      "fail_reason": "0",
      "fan_gear": 45823,
      "filam_bak": [],
      "force_upgrade": false,
      "gcode_file": "/data/Metadata/plate_1.gcode",
      "gcode_file_prepare_percent": "100",
      "gcode_state": "RUNNING",
      "heatbreak_fan_speed": "15",
      "hms": [
        {
          "attr": 83886336,
          "code": 196614
        }
      ],
      "home_flag": 6406735,
      "hw_switch_state": 1,
      "ipcam": {
        "agora_service": "disable",
        "ipcam_dev": "1",
        "ipcam_record": "enable",
        "mode_bits": 2,
        "resolution": "1080p",
        "rtsp_url": "**REDACTED**",
        "timelapse": "disable",
        "tutk_server": "enable"
      },
      "job_id": "128268856",
      "layer_num": 91,
      "lights_report": [
        {
          "mode": "on",
          "node": "chamber_light"
        },
        {
          "mode": "flashing",
          "node": "work_light"
        }
      ],
      "maintain": 131075,
      "mc_percent": 97,
      "mc_print_error_code": "0",
      "mc_print_stage": "2",
      "mc_print_sub_stage": 0,
      "mc_remaining_time": 1,
      "msg": 0,
      "net": {
        "conf": 16,
        "info": [
          {
            "ip": 3525186570,
            "mask": 16777215
          },
          {
            "ip": 0,
            "mask": 0
          }
        ]
      },
      "nozzle_diameter": "0.4",
      "nozzle_target_temper": 220.0,
      "nozzle_temper": 220.0,
      "nozzle_type": "hardened_steel",
      "online": {
        "ahb": false,
        "ext": false,
        "version": 3
      },
      "print_error": 0,
      "print_gcode_action": 0,
      "print_real_action": 0,
      "print_type": "cloud",
      "profile_id": "120477551",
      "project_id": "125128448",
      "queue_est": 0,
      "queue_number": 0,
      "queue_sts": 0,
      "queue_total": 0,
      "s_obj": [],
      "sdcard": false,
      "sequence_id": "503247",
      "spd_lvl": 2,
      "spd_mag": 100,
      "stg": [
        2,
        14,
        13
      ],
      "stg_cur": 0,
      "subtask_id": "249006765",
      "subtask_name": "Gang koof lijst v3.stl_2 + Gang koof lijst v3.stl_3 + Gang koof lijst v3.stl_1 + Gang koof lijst ...",
      "t_utc": 1725629573847,
      "task_id": "249006764",
      "total_layer_num": 93,
      "upgrade_state": {
        "ahb_new_version_number": "",
        "ams_new_version_number": "",
        "consistency_request": false,
        "dis_state": 0,
        "err_code": 0,
        "ext_new_version_number": "",
        "force_upgrade": false,
        "idx": 3,
        "idx1": 0,
        "lower_limit": "00.00.00.00",
        "message": "verifying: filament",
        "module": "",
        "new_version_state": 2,
        "ota_new_version_number": "",
        "progress": "0",
        "sequence_id": 0,
        "sn": "**REDACTED**",
        "status": "IDLE"
      },
      "upload": {
        "file_size": 0,
        "finish_size": 0,
        "message": "Good",
        "oss_url": "",
        "progress": 0,
        "sequence_id": "0903",
        "speed": 0,
        "status": "idle",
        "task_id": "",
        "time_remaining": 0,
        "trouble_id": ""
      },
      "vt_tray": {
        "bed_temp": "0",
        "bed_temp_type": "0",
        "cali_idx": -1,
        "cols": [
          "00000000"
        ],
        "ctype": 0,
        "drying_temp": "0",
        "drying_time": "0",
        "id": "254",
        "nozzle_temp_max": "240",
        "nozzle_temp_min": "190",
        "remain": 0,
        "tag_uid": "0000000000000000",
        "tray_color": "00000000",
        "tray_diameter": "0.00",
        "tray_id_name": "",
        "tray_info_idx": "GFL99",
        "tray_sub_brands": "",
        "tray_type": "PLA",
        "tray_uuid": "00000000000000000000000000000000",
        "tray_weight": "0",
        "xcam_info": "000000000000000000000000"
      },
      "wifi_signal": "-66dBm",
      "xcam": {
        "allow_skip_parts": false,
        "buildplate_marker_detector": true,
        "first_layer_inspector": true,
        "halt_print_sensitivity": "high",
        "print_halt": true,
        "printing_monitor": true,
        "spaghetti_detector": true
      },
      "xcam_status": "0"
    },
    "get_version": {
      "command": "get_version",
      "module": [
        {
          "flag": 3,
          "hw_ver": "N/A",
          "name": "ota",
          "sn": "**REDACTED**",
          "sw_ver": "01.08.02.00"
        },
        {
          "flag": 0,
          "hw_ver": "MC07",
          "name": "mc",
          "sn": "**REDACTED**",
          "sw_ver": "00.00.27.26"
        },
        {
          "flag": 0,
          "hw_ver": "SMC01",
          "name": "sm",
          "sn": "**REDACTED**",
          "sw_ver": "00.00.27.26"
        },
        {
          "flag": 0,
          "hw_ver": "TH09",
          "name": "th",
          "sn": "**REDACTED**",
          "sw_ver": "00.00.07.12"
        },
        {
          "flag": 0,
          "hw_ver": "AP05",
          "name": "ap",
          "sn": "**REDACTED**",
          "sw_ver": "00.00.32.39"
        }
      ],
      "sequence_id": "2003"
    }
  }
}

SixFive7 avatar Sep 06 '24 13:09 SixFive7