Skip to content

Commit

Permalink
fix: add compatibility for older HA versions
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Dec 15, 2019
1 parent 99d9262 commit 7d03a93
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions custom_components/alexa_media/alarm_control_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
from typing import Dict, List, Text # noqa pylint: disable=unused-import

from homeassistant import util
from homeassistant.components.alarm_control_panel import (
SUPPORT_ALARM_ARM_AWAY,
AlarmControlPanel,
)
from homeassistant.components.alarm_control_panel import AlarmControlPanel
from homeassistant.const import STATE_ALARM_ARMED_AWAY, STATE_ALARM_DISARMED
from homeassistant.helpers.event import async_call_later

Expand Down Expand Up @@ -284,4 +281,10 @@ def should_poll(self):
@property
def supported_features(self) -> int:
"""Return the list of supported features."""
try:
from homeassistant.components.alarm_control_panel import (
SUPPORT_ALARM_ARM_AWAY,
)
except ImportError:
return 0
return SUPPORT_ALARM_ARM_AWAY
2 changes: 1 addition & 1 deletion custom_components/alexa_media/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"dependencies": [],
"codeowners": ["@keatontaylor", "@alandtse"],
"requirements": ["alexapy==1.3.2"],
"homeassistant": "0.103.0"
"homeassistant": "0.96.0"
}
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"content_in_root": false,
"domains": ["media_player", "switch", "alarm_control_panel", "sensor"],
"iot_class": "cloud_poll",
"homeassistant": "0.103.0"
"homeassistant": "0.96.0"
}

0 comments on commit 7d03a93

Please sign in to comment.