mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Bump thermopro-ble to 0.8.0 (#108319)
This commit is contained in:
parent
89570a73a7
commit
3184d3b168
@ -9,6 +9,10 @@
|
|||||||
{
|
{
|
||||||
"local_name": "TP39*",
|
"local_name": "TP39*",
|
||||||
"connectable": false
|
"connectable": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"local_name": "TP96*",
|
||||||
|
"connectable": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"codeowners": ["@bdraco"],
|
"codeowners": ["@bdraco"],
|
||||||
@ -16,5 +20,5 @@
|
|||||||
"dependencies": ["bluetooth_adapters"],
|
"dependencies": ["bluetooth_adapters"],
|
||||||
"documentation": "https://www.home-assistant.io/integrations/thermopro",
|
"documentation": "https://www.home-assistant.io/integrations/thermopro",
|
||||||
"iot_class": "local_push",
|
"iot_class": "local_push",
|
||||||
"requirements": ["thermopro-ble==0.5.0"]
|
"requirements": ["thermopro-ble==0.8.0"]
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ from homeassistant.components.sensor import (
|
|||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
||||||
|
EntityCategory,
|
||||||
UnitOfTemperature,
|
UnitOfTemperature,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
@ -59,6 +60,16 @@ SENSOR_DESCRIPTIONS = {
|
|||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
entity_registry_enabled_default=False,
|
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,
|
||||||
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -534,6 +534,11 @@ BLUETOOTH: list[dict[str, bool | str | int | list[int]]] = [
|
|||||||
"domain": "thermopro",
|
"domain": "thermopro",
|
||||||
"local_name": "TP39*",
|
"local_name": "TP39*",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"connectable": False,
|
||||||
|
"domain": "thermopro",
|
||||||
|
"local_name": "TP96*",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"domain": "tilt_ble",
|
"domain": "tilt_ble",
|
||||||
"manufacturer_data_start": [
|
"manufacturer_data_start": [
|
||||||
|
@ -2662,7 +2662,7 @@ tessie-api==0.0.9
|
|||||||
thermobeacon-ble==0.6.2
|
thermobeacon-ble==0.6.2
|
||||||
|
|
||||||
# homeassistant.components.thermopro
|
# homeassistant.components.thermopro
|
||||||
thermopro-ble==0.5.0
|
thermopro-ble==0.8.0
|
||||||
|
|
||||||
# homeassistant.components.thermoworks_smoke
|
# homeassistant.components.thermoworks_smoke
|
||||||
thermoworks-smoke==0.1.8
|
thermoworks-smoke==0.1.8
|
||||||
|
@ -2018,7 +2018,7 @@ tessie-api==0.0.9
|
|||||||
thermobeacon-ble==0.6.2
|
thermobeacon-ble==0.6.2
|
||||||
|
|
||||||
# homeassistant.components.thermopro
|
# homeassistant.components.thermopro
|
||||||
thermopro-ble==0.5.0
|
thermopro-ble==0.8.0
|
||||||
|
|
||||||
# homeassistant.components.tilt_ble
|
# homeassistant.components.tilt_ble
|
||||||
tilt-ble==0.2.3
|
tilt-ble==0.2.3
|
||||||
|
@ -24,14 +24,21 @@ async def test_sensors(hass: HomeAssistant) -> None:
|
|||||||
assert len(hass.states.async_all()) == 0
|
assert len(hass.states.async_all()) == 0
|
||||||
inject_bluetooth_service_info(hass, TP357_SERVICE_INFO)
|
inject_bluetooth_service_info(hass, TP357_SERVICE_INFO)
|
||||||
await hass.async_block_till_done()
|
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 = 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.state == "24.1"
|
||||||
assert temp_sensor_attribtes[ATTR_FRIENDLY_NAME] == "TP357 (2142) Temperature"
|
assert temp_sensor_attributes[ATTR_FRIENDLY_NAME] == "TP357 (2142) Temperature"
|
||||||
assert temp_sensor_attribtes[ATTR_UNIT_OF_MEASUREMENT] == "°C"
|
assert temp_sensor_attributes[ATTR_UNIT_OF_MEASUREMENT] == "°C"
|
||||||
assert temp_sensor_attribtes[ATTR_STATE_CLASS] == "measurement"
|
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)
|
assert await hass.config_entries.async_unload(entry.entry_id)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user