Skip to content

Commit

Permalink
Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
Limych committed Feb 8, 2023
1 parent d8a0466 commit 48a57d8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 20 deletions.
3 changes: 1 addition & 2 deletions custom_components/snowtire/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
# Creative Commons BY-NC-SA 4.0 International Public License
# (see LICENSE.md or https://creativecommons.org/licenses/by-nc-sa/4.0/)
#
"""
The Snowtire binary sensor.
"""The Snowtire binary sensor.
For more details about this platform, please refer to the documentation at
https://github.com/Limych/ha-snowtire/
Expand Down
11 changes: 6 additions & 5 deletions custom_components/snowtire/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,27 @@
# Creative Commons BY-NC-SA 4.0 International Public License
# (see LICENSE.md or https://creativecommons.org/licenses/by-nc-sa/4.0/)
#
"""
The Snowtire binary sensor.
"""The Snowtire binary sensor.
For more details about this platform, please refer to the documentation at
https://github.com/Limych/ha-snowtire/
"""
import logging
from collections.abc import Callable
from datetime import datetime
from typing import Callable, Optional
import logging
from typing import Optional

import voluptuous as vol

from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.components.weather import (
ATTR_FORECAST,
ATTR_FORECAST_TEMP,
ATTR_FORECAST_TEMP_LOW,
ATTR_FORECAST_TIME,
ATTR_WEATHER_TEMPERATURE,
DOMAIN as WEATHER,
)
from homeassistant.components.weather import DOMAIN as WEATHER
from homeassistant.const import (
CONF_NAME,
CONF_UNIQUE_ID,
Expand Down
3 changes: 1 addition & 2 deletions custom_components/snowtire/const.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""
The Snowtire binary sensor.
"""The Snowtire binary sensor.
For more details about this platform, please refer to the documentation at
https://github.com/Limych/ha-snowtire/
Expand Down
22 changes: 11 additions & 11 deletions tests/test_binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@
from unittest.mock import MagicMock

import pytest
from homeassistant.components.weather import (
ATTR_FORECAST,
ATTR_FORECAST_TEMP,
ATTR_FORECAST_TEMP_LOW,
ATTR_FORECAST_TIME,
ATTR_WEATHER_TEMPERATURE,
)
from homeassistant.const import CONF_PLATFORM, TEMP_CELSIUS, TEMP_FAHRENHEIT
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.util import dt as dt_util
from pytest import raises

from custom_components.snowtire.binary_sensor import (
Expand All @@ -27,6 +16,17 @@
ICON_SUMMER,
ICON_WINTER,
)
from homeassistant.components.weather import (
ATTR_FORECAST,
ATTR_FORECAST_TEMP,
ATTR_FORECAST_TEMP_LOW,
ATTR_FORECAST_TIME,
ATTR_WEATHER_TEMPERATURE,
)
from homeassistant.const import CONF_PLATFORM, TEMP_CELSIUS, TEMP_FAHRENHEIT
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.util import dt as dt_util

MOCK_UNIQUE_ID: Final = "test_id"
MOCK_NAME: Final = "test_name"
Expand Down

0 comments on commit 48a57d8

Please sign in to comment.