diff --git a/homeassistant/components/bthome/__init__.py b/homeassistant/components/bthome/__init__.py index 4cc3b5cf4da..93ebd7b288f 100644 --- a/homeassistant/components/bthome/__init__.py +++ b/homeassistant/components/bthome/__init__.py @@ -1,9 +1,9 @@ -"""The BThome Bluetooth integration.""" +"""The BTHome Bluetooth integration.""" from __future__ import annotations import logging -from bthome_ble import BThomeBluetoothDeviceData, SensorUpdate +from bthome_ble import BTHomeBluetoothDeviceData, SensorUpdate from bthome_ble.parser import EncryptionScheme from homeassistant.components.bluetooth import ( @@ -27,7 +27,7 @@ _LOGGER = logging.getLogger(__name__) def process_service_info( hass: HomeAssistant, entry: ConfigEntry, - data: BThomeBluetoothDeviceData, + data: BTHomeBluetoothDeviceData, service_info: BluetoothServiceInfoBleak, ) -> SensorUpdate: """Process a BluetoothServiceInfoBleak, running side effects and returning sensor data.""" @@ -40,14 +40,14 @@ def process_service_info( async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: - """Set up BThome Bluetooth from a config entry.""" + """Set up BTHome Bluetooth from a config entry.""" address = entry.unique_id assert address is not None kwargs = {} if bindkey := entry.data.get("bindkey"): kwargs["bindkey"] = bytes.fromhex(bindkey) - data = BThomeBluetoothDeviceData(**kwargs) + data = BTHomeBluetoothDeviceData(**kwargs) coordinator = hass.data.setdefault(DOMAIN, {})[ entry.entry_id diff --git a/homeassistant/components/bthome/config_flow.py b/homeassistant/components/bthome/config_flow.py index e8e49cab566..6514f2c5396 100644 --- a/homeassistant/components/bthome/config_flow.py +++ b/homeassistant/components/bthome/config_flow.py @@ -1,11 +1,11 @@ -"""Config flow for BThome Bluetooth integration.""" +"""Config flow for BTHome Bluetooth integration.""" from __future__ import annotations from collections.abc import Mapping import dataclasses from typing import Any -from bthome_ble import BThomeBluetoothDeviceData as DeviceData +from bthome_ble import BTHomeBluetoothDeviceData as DeviceData from bthome_ble.parser import EncryptionScheme import voluptuous as vol @@ -34,8 +34,8 @@ def _title(discovery_info: BluetoothServiceInfo, device: DeviceData) -> str: return device.title or device.get_device_name() or discovery_info.name -class BThomeConfigFlow(ConfigFlow, domain=DOMAIN): - """Handle a config flow for BThome Bluetooth.""" +class BTHomeConfigFlow(ConfigFlow, domain=DOMAIN): + """Handle a config flow for BTHome Bluetooth.""" VERSION = 1 @@ -68,7 +68,7 @@ class BThomeConfigFlow(ConfigFlow, domain=DOMAIN): async def async_step_get_encryption_key( self, user_input: dict[str, Any] | None = None ) -> FlowResult: - """Enter a bindkey for an encrypted BThome device.""" + """Enter a bindkey for an encrypted BTHome device.""" assert self._discovery_info assert self._discovered_device diff --git a/homeassistant/components/bthome/const.py b/homeassistant/components/bthome/const.py index e397e288071..e46aa50e148 100644 --- a/homeassistant/components/bthome/const.py +++ b/homeassistant/components/bthome/const.py @@ -1,3 +1,3 @@ -"""Constants for the BThome Bluetooth integration.""" +"""Constants for the BTHome Bluetooth integration.""" DOMAIN = "bthome" diff --git a/homeassistant/components/bthome/device.py b/homeassistant/components/bthome/device.py index f16b2f49998..bd011752db1 100644 --- a/homeassistant/components/bthome/device.py +++ b/homeassistant/components/bthome/device.py @@ -1,4 +1,4 @@ -"""Support for BThome Bluetooth devices.""" +"""Support for BTHome Bluetooth devices.""" from __future__ import annotations from bthome_ble import DeviceKey, SensorDeviceInfo diff --git a/homeassistant/components/bthome/manifest.json b/homeassistant/components/bthome/manifest.json index bdb4b75bfa9..597d52c72e4 100644 --- a/homeassistant/components/bthome/manifest.json +++ b/homeassistant/components/bthome/manifest.json @@ -1,6 +1,6 @@ { "domain": "bthome", - "name": "BThome", + "name": "BTHome", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/bthome", "bluetooth": [ @@ -13,7 +13,7 @@ "service_data_uuid": "0000181e-0000-1000-8000-00805f9b34fb" } ], - "requirements": ["bthome-ble==0.5.2"], + "requirements": ["bthome-ble==1.0.0"], "dependencies": ["bluetooth"], "codeowners": ["@Ernst79"], "iot_class": "local_push" diff --git a/homeassistant/components/bthome/sensor.py b/homeassistant/components/bthome/sensor.py index 71601fa24c0..a0068596b01 100644 --- a/homeassistant/components/bthome/sensor.py +++ b/homeassistant/components/bthome/sensor.py @@ -1,4 +1,4 @@ -"""Support for BThome sensors.""" +"""Support for BTHome sensors.""" from __future__ import annotations from typing import Optional, Union @@ -202,26 +202,26 @@ async def async_setup_entry( entry: config_entries.ConfigEntry, async_add_entities: AddEntitiesCallback, ) -> None: - """Set up the BThome BLE sensors.""" + """Set up the BTHome BLE sensors.""" coordinator: PassiveBluetoothProcessorCoordinator = hass.data[DOMAIN][ entry.entry_id ] processor = PassiveBluetoothDataProcessor(sensor_update_to_bluetooth_data_update) entry.async_on_unload( processor.async_add_entities_listener( - BThomeBluetoothSensorEntity, async_add_entities + BTHomeBluetoothSensorEntity, async_add_entities ) ) entry.async_on_unload(coordinator.async_register_processor(processor)) -class BThomeBluetoothSensorEntity( +class BTHomeBluetoothSensorEntity( PassiveBluetoothProcessorEntity[ PassiveBluetoothDataProcessor[Optional[Union[float, int]]] ], SensorEntity, ): - """Representation of a BThome BLE sensor.""" + """Representation of a BTHome BLE sensor.""" @property def native_value(self) -> int | float | None: diff --git a/requirements_all.txt b/requirements_all.txt index e47fbf90259..97503052108 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -464,7 +464,7 @@ bsblan==0.5.0 bt_proximity==0.2.1 # homeassistant.components.bthome -bthome-ble==0.5.2 +bthome-ble==1.0.0 # homeassistant.components.bt_home_hub_5 bthomehub5-devicelist==0.1.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index b0ce1392ed8..213d10a20b4 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -365,7 +365,7 @@ brunt==1.2.0 bsblan==0.5.0 # homeassistant.components.bthome -bthome-ble==0.5.2 +bthome-ble==1.0.0 # homeassistant.components.buienradar buienradar==1.0.5 diff --git a/tests/components/bthome/__init__.py b/tests/components/bthome/__init__.py index be59cd7e8cb..e480c0a3810 100644 --- a/tests/components/bthome/__init__.py +++ b/tests/components/bthome/__init__.py @@ -1,4 +1,4 @@ -"""Tests for the BThome integration.""" +"""Tests for the BTHome integration.""" from bleak.backends.device import BLEDevice from bleak.backends.scanner import AdvertisementData diff --git a/tests/components/bthome/test_config_flow.py b/tests/components/bthome/test_config_flow.py index fd8f8dfaa35..64a298e3460 100644 --- a/tests/components/bthome/test_config_flow.py +++ b/tests/components/bthome/test_config_flow.py @@ -1,8 +1,8 @@ -"""Test the BThome config flow.""" +"""Test the BTHome config flow.""" from unittest.mock import patch -from bthome_ble import BThomeBluetoothDeviceData as DeviceData +from bthome_ble import BTHomeBluetoothDeviceData as DeviceData from homeassistant import config_entries from homeassistant.components.bluetooth import BluetoothChange @@ -167,7 +167,7 @@ async def test_async_step_user_no_devices_found_2(hass): """ Test setup from service info cache with no devices found. - This variant tests with a non-BThome device known to us. + This variant tests with a non-BTHome device known to us. """ with patch( "homeassistant.components.xiaomi_ble.config_flow.async_discovered_service_info", diff --git a/tests/components/bthome/test_sensor.py b/tests/components/bthome/test_sensor.py index f73d3bf379c..bb0c5b3f459 100644 --- a/tests/components/bthome/test_sensor.py +++ b/tests/components/bthome/test_sensor.py @@ -1,4 +1,4 @@ -"""Test the BThome sensors.""" +"""Test the BTHome sensors.""" from unittest.mock import patch