Skip to content

Commit

Permalink
Remove deprecated code. (#932)
Browse files Browse the repository at this point in the history
  • Loading branch information
twrecked authored May 3, 2024
1 parent eba7d13 commit 9d9da9f
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 48 deletions.
2 changes: 2 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
aarlo
0.8.1.1
Fix some deprecated warnings.
0.8.1
Move out of beta. It has been long enough...
0.8.1b15
Expand Down
2 changes: 1 addition & 1 deletion custom_components/aarlo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
from .cfg import BlendedCfg, PyaarloCfg


__version__ = "0.8.1"
__version__ = "0.8.1.1"

_LOGGER = logging.getLogger(__name__)

Expand Down
13 changes: 6 additions & 7 deletions custom_components/aarlo/alarm_control_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@
STATE_ALARM_DISARMED,
STATE_ALARM_TRIGGERED,
)
from homeassistant.core import callback, HassJob
from homeassistant.core import HomeAssistant, HassJob
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.config_validation import PLATFORM_SCHEMA
from homeassistant.helpers.event import async_track_point_in_time
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType

from pyaarlo.constant import (
MODE_KEY,
Expand Down Expand Up @@ -100,7 +99,7 @@


async def async_setup_entry(
hass: HomeAssistantType,
hass: HomeAssistant,
_entry: ConfigEntry,
async_add_entities: Callable[[list], None],
) -> None:
Expand Down Expand Up @@ -154,11 +153,11 @@ async def async_service_callback(call):

# Websockets.
if base_stations_with_sirens:
hass.components.websocket_api.async_register_command(
WS_TYPE_SIREN_ON, websocket_siren_on, SCHEMA_WS_SIREN_ON
websocket_api.async_register_command(
hass, WS_TYPE_SIREN_ON, websocket_siren_on, SCHEMA_WS_SIREN_ON
)
hass.components.websocket_api.async_register_command(
WS_TYPE_SIREN_OFF, websocket_siren_off, SCHEMA_WS_SIREN_OFF
websocket_api.async_register_command(
hass, WS_TYPE_SIREN_OFF, websocket_siren_off, SCHEMA_WS_SIREN_OFF
)


Expand Down
5 changes: 2 additions & 3 deletions custom_components/aarlo/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
DOMAIN as BINARY_SENSOR_DOMAIN
)
from homeassistant.const import ATTR_ATTRIBUTION, CONF_MONITORED_CONDITIONS
from homeassistant.core import callback
from homeassistant.core import HomeAssistant
from homeassistant.helpers.config_validation import PLATFORM_SCHEMA
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType

from pyaarlo.constant import (
ALS_STATE_KEY,
Expand Down Expand Up @@ -82,7 +81,7 @@


async def async_setup_entry(
hass: HomeAssistantType,
hass: HomeAssistant,
_entry: ConfigEntry,
async_add_entities: Callable[[list], None],
) -> None:
Expand Down
41 changes: 20 additions & 21 deletions custom_components/aarlo/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@
CONF_FILENAME,
STATE_ALARM_DISARMED
)
from homeassistant.core import callback
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.aiohttp_client import async_aiohttp_proxy_stream
from homeassistant.helpers.config_validation import PLATFORM_SCHEMA
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType

import pyaarlo
from pyaarlo.constant import (
Expand Down Expand Up @@ -184,7 +183,7 @@


async def async_setup_entry(
hass: HomeAssistantType,
hass: HomeAssistant,
_entry: ConfigEntry,
async_add_entities: Callable[[list], None],
) -> None:
Expand Down Expand Up @@ -263,33 +262,33 @@ async def async_service_callback(call):
)

# Websockets
hass.components.websocket_api.async_register_command(
WS_TYPE_VIDEO_URL, websocket_video_url, SCHEMA_WS_VIDEO_URL
websocket_api.async_register_command(
hass, WS_TYPE_VIDEO_URL, websocket_video_url, SCHEMA_WS_VIDEO_URL
)
hass.components.websocket_api.async_register_command(
WS_TYPE_LIBRARY, websocket_library, SCHEMA_WS_LIBRARY
websocket_api.async_register_command(
hass, WS_TYPE_LIBRARY, websocket_library, SCHEMA_WS_LIBRARY
)
hass.components.websocket_api.async_register_command(
WS_TYPE_STREAM_URL, websocket_stream_url, SCHEMA_WS_STREAM_URL
websocket_api.async_register_command(
hass, WS_TYPE_STREAM_URL, websocket_stream_url, SCHEMA_WS_STREAM_URL
)
hass.components.websocket_api.async_register_command(
WS_TYPE_SNAPSHOT_IMAGE, websocket_snapshot_image, SCHEMA_WS_SNAPSHOT_IMAGE
websocket_api.async_register_command(
hass, WS_TYPE_SNAPSHOT_IMAGE, websocket_snapshot_image, SCHEMA_WS_SNAPSHOT_IMAGE
)
hass.components.websocket_api.async_register_command(
WS_TYPE_REQUEST_SNAPSHOT, websocket_request_snapshot, SCHEMA_WS_REQUEST_SNAPSHOT
websocket_api.async_register_command(
hass, WS_TYPE_REQUEST_SNAPSHOT, websocket_request_snapshot, SCHEMA_WS_REQUEST_SNAPSHOT
)
hass.components.websocket_api.async_register_command(
WS_TYPE_VIDEO_DATA, websocket_video_data, SCHEMA_WS_VIDEO_DATA
websocket_api.async_register_command(
hass, WS_TYPE_VIDEO_DATA, websocket_video_data, SCHEMA_WS_VIDEO_DATA
)
hass.components.websocket_api.async_register_command(
WS_TYPE_STOP_ACTIVITY, websocket_stop_activity, SCHEMA_WS_STOP_ACTIVITY
websocket_api.async_register_command(
hass, WS_TYPE_STOP_ACTIVITY, websocket_stop_activity, SCHEMA_WS_STOP_ACTIVITY
)
if cameras_with_siren:
hass.components.websocket_api.async_register_command(
WS_TYPE_SIREN_ON, websocket_siren_on, SCHEMA_WS_SIREN_ON
websocket_api.async_register_command(
hass, WS_TYPE_SIREN_ON, websocket_siren_on, SCHEMA_WS_SIREN_ON
)
hass.components.websocket_api.async_register_command(
WS_TYPE_SIREN_OFF, websocket_siren_off, SCHEMA_WS_SIREN_OFF
websocket_api.async_register_command(
hass, WS_TYPE_SIREN_OFF, websocket_siren_off, SCHEMA_WS_SIREN_OFF
)


Expand Down
5 changes: 2 additions & 3 deletions custom_components/aarlo/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@
ATTR_BATTERY_CHARGING,
ATTR_BATTERY_LEVEL,
)
from homeassistant.core import callback
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType

from pyaarlo.constant import (
BRIGHTNESS_KEY,
Expand Down Expand Up @@ -64,7 +63,7 @@


async def async_setup_entry(
hass: HomeAssistantType,
hass: HomeAssistant,
_entry: ConfigEntry,
async_add_entities: Callable[[list], None],
) -> None:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/aarlo/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"unidecode",
"pyaarlo>=0.8.0.6"
],
"version": "0.8.1"
"version": "0.8.1.1"
}
5 changes: 2 additions & 3 deletions custom_components/aarlo/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@
from homeassistant.const import (
ATTR_ATTRIBUTION,
)
from homeassistant.core import callback
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType

from pyaarlo.constant import MEDIA_PLAYER_KEY

Expand Down Expand Up @@ -67,7 +66,7 @@


async def async_setup_entry(
hass: HomeAssistantType,
hass: HomeAssistant,
_entry: ConfigEntry,
async_add_entities: Callable[[list], None],
) -> None:
Expand Down
5 changes: 2 additions & 3 deletions custom_components/aarlo/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
CONF_MONITORED_CONDITIONS,
UnitOfTemperature,
)
from homeassistant.core import callback
from homeassistant.core import HomeAssistant
from homeassistant.helpers.config_validation import PLATFORM_SCHEMA
from homeassistant.helpers.entity import Entity
from homeassistant.components.sensor import (
Expand All @@ -25,7 +25,6 @@
)
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.util import slugify

from pyaarlo.constant import (
Expand Down Expand Up @@ -88,7 +87,7 @@


async def async_setup_entry(
hass: HomeAssistantType,
hass: HomeAssistant,
_entry: ConfigEntry,
async_add_entities: Callable[[list], None],
) -> None:
Expand Down
5 changes: 2 additions & 3 deletions custom_components/aarlo/siren.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
from homeassistant.components.siren.const import (
SirenEntityFeature
)
from homeassistant.core import callback
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.util import slugify

from pyaarlo.constant import (
Expand All @@ -36,7 +35,7 @@


async def async_setup_entry(
hass: HomeAssistantType,
hass: HomeAssistant,
_entry: ConfigEntry,
async_add_entities: Callable[[list], None],
) -> None:
Expand Down
5 changes: 2 additions & 3 deletions custom_components/aarlo/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
SwitchEntity
)
from homeassistant.const import ATTR_ATTRIBUTION
from homeassistant.core import callback, HassJob
from homeassistant.core import HomeAssistant, HassJob
from homeassistant.helpers.config_validation import PLATFORM_SCHEMA
from homeassistant.helpers.event import async_track_point_in_time
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.util import slugify

from pyaarlo.constant import (
Expand Down Expand Up @@ -61,7 +60,7 @@


async def async_setup_entry(
hass: HomeAssistantType,
hass: HomeAssistant,
_entry: ConfigEntry,
async_add_entities: Callable[[list], None]
) -> None:
Expand Down

0 comments on commit 9d9da9f

Please sign in to comment.