Bump thermopro-ble to 0.8.0 (#108319)

This commit is contained in:
J. Nick Koston 2024-01-19 17:56:35 -10:00 committed by GitHub
parent 89570a73a7
commit 3184d3b168
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 35 additions and 8 deletions

View File

@ -9,6 +9,10 @@
{
"local_name": "TP39*",
"connectable": false
},
{
"local_name": "TP96*",
"connectable": false
}
],
"codeowners": ["@bdraco"],
@ -16,5 +20,5 @@
"dependencies": ["bluetooth_adapters"],
"documentation": "https://www.home-assistant.io/integrations/thermopro",
"iot_class": "local_push",
"requirements": ["thermopro-ble==0.5.0"]
"requirements": ["thermopro-ble==0.8.0"]
}

View File

@ -25,6 +25,7 @@ from homeassistant.components.sensor import (
from homeassistant.const import (
PERCENTAGE,
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
EntityCategory,
UnitOfTemperature,
)
from homeassistant.core import HomeAssistant
@ -59,6 +60,16 @@ SENSOR_DESCRIPTIONS = {
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
),
(
ThermoProSensorDeviceClass.BATTERY,
Units.PERCENTAGE,
): SensorEntityDescription(
key=f"{ThermoProSensorDeviceClass.BATTERY}_{Units.PERCENTAGE}",
device_class=SensorDeviceClass.BATTERY,
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
),
}

View File

@ -534,6 +534,11 @@ BLUETOOTH: list[dict[str, bool | str | int | list[int]]] = [
"domain": "thermopro",
"local_name": "TP39*",
},
{
"connectable": False,
"domain": "thermopro",
"local_name": "TP96*",
},
{
"domain": "tilt_ble",
"manufacturer_data_start": [

View File

@ -2662,7 +2662,7 @@ tessie-api==0.0.9
thermobeacon-ble==0.6.2
# homeassistant.components.thermopro
thermopro-ble==0.5.0
thermopro-ble==0.8.0
# homeassistant.components.thermoworks_smoke
thermoworks-smoke==0.1.8

View File

@ -2018,7 +2018,7 @@ tessie-api==0.0.9
thermobeacon-ble==0.6.2
# homeassistant.components.thermopro
thermopro-ble==0.5.0
thermopro-ble==0.8.0
# homeassistant.components.tilt_ble
tilt-ble==0.2.3

View File

@ -24,14 +24,21 @@ async def test_sensors(hass: HomeAssistant) -> None:
assert len(hass.states.async_all()) == 0
inject_bluetooth_service_info(hass, TP357_SERVICE_INFO)
await hass.async_block_till_done()
assert len(hass.states.async_all()) == 2
assert len(hass.states.async_all()) == 3
temp_sensor = hass.states.get("sensor.tp357_2142_temperature")
temp_sensor_attribtes = temp_sensor.attributes
temp_sensor_attributes = temp_sensor.attributes
assert temp_sensor.state == "24.1"
assert temp_sensor_attribtes[ATTR_FRIENDLY_NAME] == "TP357 (2142) Temperature"
assert temp_sensor_attribtes[ATTR_UNIT_OF_MEASUREMENT] == "°C"
assert temp_sensor_attribtes[ATTR_STATE_CLASS] == "measurement"
assert temp_sensor_attributes[ATTR_FRIENDLY_NAME] == "TP357 (2142) Temperature"
assert temp_sensor_attributes[ATTR_UNIT_OF_MEASUREMENT] == "°C"
assert temp_sensor_attributes[ATTR_STATE_CLASS] == "measurement"
battery_sensor = hass.states.get("sensor.tp357_2142_battery")
battery_sensor_attributes = battery_sensor.attributes
assert battery_sensor.state == "100"
assert battery_sensor_attributes[ATTR_FRIENDLY_NAME] == "TP357 (2142) Battery"
assert battery_sensor_attributes[ATTR_UNIT_OF_MEASUREMENT] == "%"
assert battery_sensor_attributes[ATTR_STATE_CLASS] == "measurement"
assert await hass.config_entries.async_unload(entry.entry_id)
await hass.async_block_till_done()