Skip to content

Commit 05940a8

Browse files
committed
feat: drop support of HA before 2021.7
set minimum homeassistant version in hacs.json
1 parent 37d2edb commit 05940a8

3 files changed

Lines changed: 4 additions & 11 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![version_badge](https://img.shields.io/badge/recommended%20HA%20version-2021.7-red)
1+
![version_badge](https://img.shields.io/badge/minimum%20HA%20version-2021.7-red)
22
![Validate with hassfest](https://github.com/IATkachenko/HA-SleepAsAndroid/workflows/Validate%20with%20hassfest/badge.svg)
33
[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg)](https://github.com/custom-components/hacs)
44
[![Custom badge](https://img.shields.io/endpoint?color=orange&label=patreon&url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%2F%3Fusername%3DIATkachenko%26type%3Dpatrons)](https://www.patreon.com/IATkachenko)

custom_components/sleep_as_android/device_trigger.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
import logging
22
import voluptuous as vol
3-
from distutils.version import StrictVersion
43

54
from homeassistant.const import (CONF_TYPE, CONF_PLATFORM, CONF_DOMAIN, CONF_DEVICE_ID, )
6-
from homeassistant.const import __version__ as homeassistant_version
75
from homeassistant.components.homeassistant.triggers import event as event_trigger
86
from homeassistant.core import HomeAssistant
7+
from homeassistant.components.device_automation import DEVICE_TRIGGER_BASE_SCHEMA as HA_TRIGGER_BASE_SCHEMA
98

109
from .const import DOMAIN
1110

12-
_LOGGER = logging.getLogger(__name__)
1311

14-
if StrictVersion(homeassistant_version) >= StrictVersion("2021.7"):
15-
from homeassistant.components.device_automation import DEVICE_TRIGGER_BASE_SCHEMA as HA_TRIGGER_BASE_SCHEMA
16-
else:
17-
# TRIGGER_BASE_SCHEMA was renamed to DEVICE_TRIGGER_BASE_SCHEMA in 2021.7
18-
_LOGGER.info("You are using old version (%s) of Home Assistant. Support of this version by the integration may be "
19-
"dropped.", homeassistant_version)
20-
from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA as HA_TRIGGER_BASE_SCHEMA
12+
_LOGGER = logging.getLogger(__name__)
2113

2214
# available at https://docs.sleep.urbandroid.org/services/automation.html#events
2315
TRIGGERS = [

hacs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"homeassistant": "2021.7.0",
23
"name": "Sleep As Android",
34
"render_readme": true,
45
"zip_release": true,

0 commit comments

Comments
 (0)