mirror of
https://github.com/home-assistant/core
synced 2024-09-28 03:04:04 +02:00
Bump airthings_ble to 0.7.1 (#113172)
Co-authored-by: Ståle Storø Hauknes <LaStrada@users.noreply.github.com>
This commit is contained in:
parent
45fb5bcb42
commit
d2bd68ba30
@ -28,7 +28,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
hass.data.setdefault(DOMAIN, {})
|
hass.data.setdefault(DOMAIN, {})
|
||||||
address = entry.unique_id
|
address = entry.unique_id
|
||||||
|
|
||||||
elevation = hass.config.elevation
|
|
||||||
is_metric = hass.config.units is METRIC_SYSTEM
|
is_metric = hass.config.units is METRIC_SYSTEM
|
||||||
assert address is not None
|
assert address is not None
|
||||||
|
|
||||||
@ -41,7 +40,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
f"Could not find Airthings device with address {address}"
|
f"Could not find Airthings device with address {address}"
|
||||||
)
|
)
|
||||||
|
|
||||||
airthings = AirthingsBluetoothDeviceData(_LOGGER, elevation, is_metric)
|
airthings = AirthingsBluetoothDeviceData(_LOGGER, is_metric)
|
||||||
|
|
||||||
async def _async_update_method() -> AirthingsDevice:
|
async def _async_update_method() -> AirthingsDevice:
|
||||||
"""Get data from Airthings BLE."""
|
"""Get data from Airthings BLE."""
|
||||||
|
@ -24,5 +24,5 @@
|
|||||||
"dependencies": ["bluetooth_adapters"],
|
"dependencies": ["bluetooth_adapters"],
|
||||||
"documentation": "https://www.home-assistant.io/integrations/airthings_ble",
|
"documentation": "https://www.home-assistant.io/integrations/airthings_ble",
|
||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
"requirements": ["airthings-ble==0.6.1"]
|
"requirements": ["airthings-ble==0.7.1"]
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@ from homeassistant.config_entries import ConfigEntry
|
|||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONCENTRATION_PARTS_PER_BILLION,
|
CONCENTRATION_PARTS_PER_BILLION,
|
||||||
CONCENTRATION_PARTS_PER_MILLION,
|
CONCENTRATION_PARTS_PER_MILLION,
|
||||||
LIGHT_LUX,
|
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
EntityCategory,
|
EntityCategory,
|
||||||
Platform,
|
Platform,
|
||||||
@ -109,8 +108,7 @@ SENSORS_MAPPING_TEMPLATE: dict[str, SensorEntityDescription] = {
|
|||||||
),
|
),
|
||||||
"illuminance": SensorEntityDescription(
|
"illuminance": SensorEntityDescription(
|
||||||
key="illuminance",
|
key="illuminance",
|
||||||
device_class=SensorDeviceClass.ILLUMINANCE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
native_unit_of_measurement=LIGHT_LUX,
|
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
@ -226,7 +224,7 @@ class AirthingsSensor(
|
|||||||
manufacturer=airthings_device.manufacturer,
|
manufacturer=airthings_device.manufacturer,
|
||||||
hw_version=airthings_device.hw_version,
|
hw_version=airthings_device.hw_version,
|
||||||
sw_version=airthings_device.sw_version,
|
sw_version=airthings_device.sw_version,
|
||||||
model=airthings_device.model,
|
model=airthings_device.model.name,
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -416,7 +416,7 @@ aioymaps==1.2.2
|
|||||||
airly==1.1.0
|
airly==1.1.0
|
||||||
|
|
||||||
# homeassistant.components.airthings_ble
|
# homeassistant.components.airthings_ble
|
||||||
airthings-ble==0.6.1
|
airthings-ble==0.7.1
|
||||||
|
|
||||||
# homeassistant.components.airthings
|
# homeassistant.components.airthings
|
||||||
airthings-cloud==0.2.0
|
airthings-cloud==0.2.0
|
||||||
|
@ -389,7 +389,7 @@ aioymaps==1.2.2
|
|||||||
airly==1.1.0
|
airly==1.1.0
|
||||||
|
|
||||||
# homeassistant.components.airthings_ble
|
# homeassistant.components.airthings_ble
|
||||||
airthings-ble==0.6.1
|
airthings-ble==0.7.1
|
||||||
|
|
||||||
# homeassistant.components.airthings
|
# homeassistant.components.airthings
|
||||||
airthings-cloud==0.2.0
|
airthings-cloud==0.2.0
|
||||||
|
@ -4,7 +4,11 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from airthings_ble import AirthingsBluetoothDeviceData, AirthingsDevice
|
from airthings_ble import (
|
||||||
|
AirthingsBluetoothDeviceData,
|
||||||
|
AirthingsDevice,
|
||||||
|
AirthingsDeviceType,
|
||||||
|
)
|
||||||
|
|
||||||
from homeassistant.components.airthings_ble.const import DOMAIN
|
from homeassistant.components.airthings_ble.const import DOMAIN
|
||||||
from homeassistant.components.bluetooth.models import BluetoothServiceInfoBleak
|
from homeassistant.components.bluetooth.models import BluetoothServiceInfoBleak
|
||||||
@ -162,8 +166,7 @@ WAVE_DEVICE_INFO = AirthingsDevice(
|
|||||||
manufacturer="Airthings AS",
|
manufacturer="Airthings AS",
|
||||||
hw_version="REV A",
|
hw_version="REV A",
|
||||||
sw_version="G-BLE-1.5.3-master+0",
|
sw_version="G-BLE-1.5.3-master+0",
|
||||||
model="Wave Plus",
|
model=AirthingsDeviceType.WAVE_PLUS,
|
||||||
model_raw="2930",
|
|
||||||
name="Airthings Wave+",
|
name="Airthings Wave+",
|
||||||
identifier="123456",
|
identifier="123456",
|
||||||
sensors={
|
sensors={
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from airthings_ble import AirthingsDevice
|
from airthings_ble import AirthingsDevice, AirthingsDeviceType
|
||||||
from bleak import BleakError
|
from bleak import BleakError
|
||||||
|
|
||||||
from homeassistant.components.airthings_ble.const import DOMAIN
|
from homeassistant.components.airthings_ble.const import DOMAIN
|
||||||
@ -29,8 +29,7 @@ async def test_bluetooth_discovery(hass: HomeAssistant) -> None:
|
|||||||
with patch_async_ble_device_from_address(WAVE_SERVICE_INFO), patch_airthings_ble(
|
with patch_async_ble_device_from_address(WAVE_SERVICE_INFO), patch_airthings_ble(
|
||||||
AirthingsDevice(
|
AirthingsDevice(
|
||||||
manufacturer="Airthings AS",
|
manufacturer="Airthings AS",
|
||||||
model="Wave Plus",
|
model=AirthingsDeviceType.WAVE_PLUS,
|
||||||
model_raw="2930",
|
|
||||||
name="Airthings Wave Plus",
|
name="Airthings Wave Plus",
|
||||||
identifier="123456",
|
identifier="123456",
|
||||||
)
|
)
|
||||||
@ -112,8 +111,7 @@ async def test_user_setup(hass: HomeAssistant) -> None:
|
|||||||
), patch_async_ble_device_from_address(WAVE_SERVICE_INFO), patch_airthings_ble(
|
), patch_async_ble_device_from_address(WAVE_SERVICE_INFO), patch_airthings_ble(
|
||||||
AirthingsDevice(
|
AirthingsDevice(
|
||||||
manufacturer="Airthings AS",
|
manufacturer="Airthings AS",
|
||||||
model="Wave Plus",
|
model=AirthingsDeviceType.WAVE_PLUS,
|
||||||
model_raw="2930",
|
|
||||||
name="Airthings Wave Plus",
|
name="Airthings Wave Plus",
|
||||||
identifier="123456",
|
identifier="123456",
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user