File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -337,7 +337,7 @@ all [contributors of aiobmsble](https://github.com/patman15/aiobmsble?tab=readme
337337[license-shield] : https://img.shields.io/github/license/patman15/BMS_BLE-HA?style=for-the-badge&color=orange&cacheSeconds=86400
338338[releases-shield] : https://img.shields.io/github/release/patman15/BMS_BLE-HA.svg?style=for-the-badge&cacheSeconds=14400
339339[releases] : https://github.com//patman15/BMS_BLE-HA/releases
340- [effort-shield] : https://img.shields.io/badge/Effort%20spent-1060_hours -gold?style=for-the-badge&cacheSeconds=86400
340+ [effort-shield] : https://img.shields.io/badge/Effort%20spent-1065_hours -gold?style=for-the-badge&cacheSeconds=86400
341341[install-shield] : https://img.shields.io/badge/dynamic/json?style=for-the-badge&color=green&label=HACS&suffix=%20Installs&cacheSeconds=15600&url=https://analytics.home-assistant.io/custom_integrations.json&query=$.bms_ble.total&cacheSeconds=14400
342342[btproxy-url] : https://esphome.io/components/bluetooth_proxy
343343[custint-url] : https://www.home-assistant.io/common-tasks/general/#defining-a-custom-polling-interval
Original file line number Diff line number Diff line change 33from collections .abc import Awaitable , Buffer , Callable , Iterable
44import logging
55from typing import Any , Final
6+ from unittest .mock import MagicMock
67from uuid import UUID
78
89from aiobmsble import BMSInfo , BMSSample , MatcherPattern
@@ -42,6 +43,16 @@ def auto_enable_custom_integrations(enable_custom_integrations: None) -> None:
4243 return
4344
4445
46+ @pytest .fixture (autouse = True )
47+ def fix_HaScanner_patch (monkeypatch : pytest .MonkeyPatch ) -> None :
48+ """Patch HaScanner to avoid BT discovery.
49+
50+ fixes https://github.com/MatthewFlamm/pytest-homeassistant-custom-component/pull/255
51+ TODO: remove when pytest-homeassistant-custom-component is updated or fixed upstream
52+ """
53+ monkeypatch .setattr ("homeassistant.components.bluetooth.HaScanner" , MagicMock ())
54+
55+
4556@pytest .fixture (params = [False , True ])
4657def bool_fixture (request : pytest .FixtureRequest ) -> bool :
4758 """Return False, True for tests."""
You can’t perform that action at this time.
0 commit comments