Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecation fixes #300

Merged
merged 3 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions custom_components/nest_protect/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
SensorEntity,
SensorEntityDescription,
)
from homeassistant.const import PERCENTAGE, TEMP_CELSIUS
from homeassistant.const import PERCENTAGE, UnitOfTemperature
from homeassistant.helpers.entity import EntityCategory
from homeassistant.helpers.typing import StateType

Expand Down Expand Up @@ -99,7 +99,7 @@ class NestProtectSensorDescription(SensorEntityDescription):
key="current_temperature",
value_fn=lambda state: round(state, 2),
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=TEMP_CELSIUS,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
),
# TODO Add Color Status (gray, green, yellow, red)
# TODO Smoke Status (OK, Warning, Emergency)
Expand Down
6 changes: 3 additions & 3 deletions tests/pynest/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@pytest.mark.enable_socket
async def test_get_access_token_from_cookies_success(
socket_enabled, aiohttp_client, loop
socket_enabled, aiohttp_client, event_loop
):
"""Test getting an access token."""

Expand Down Expand Up @@ -38,7 +38,7 @@ async def make_token_response(request):

@pytest.mark.enable_socket
async def test_get_access_token_from_cookies_error(
socket_enabled, aiohttp_client, loop
socket_enabled, aiohttp_client, event_loop
):
"""Test failure while getting an access token."""

Expand All @@ -57,7 +57,7 @@ async def make_token_response(request):


@pytest.mark.enable_socket
async def test_get_first_data_success(socket_enabled, aiohttp_client, loop):
async def test_get_first_data_success(socket_enabled, aiohttp_client, event_loop):
"""Test getting initial data from the API."""

async def api_response(request):
Expand Down