mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Add alarmdecoder brand specific arming sequences (#36692)
* add adext * rm new config parameter * update adext
This commit is contained in:
parent
b15caf31a9
commit
9a867cbb75
@ -2,7 +2,7 @@
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from alarmdecoder import AlarmDecoder
|
from adext import AdExt
|
||||||
from alarmdecoder.devices import SerialDevice, SocketDevice, USBDevice
|
from alarmdecoder.devices import SerialDevice, SocketDevice, USBDevice
|
||||||
from alarmdecoder.util import NoDeviceError
|
from alarmdecoder.util import NoDeviceError
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
@ -189,13 +189,13 @@ def setup(hass, config):
|
|||||||
if device_type == "socket":
|
if device_type == "socket":
|
||||||
host = device[CONF_HOST]
|
host = device[CONF_HOST]
|
||||||
port = device[CONF_DEVICE_PORT]
|
port = device[CONF_DEVICE_PORT]
|
||||||
controller = AlarmDecoder(SocketDevice(interface=(host, port)))
|
controller = AdExt(SocketDevice(interface=(host, port)))
|
||||||
elif device_type == "serial":
|
elif device_type == "serial":
|
||||||
path = device[CONF_DEVICE_PATH]
|
path = device[CONF_DEVICE_PATH]
|
||||||
baud = device[CONF_DEVICE_BAUD]
|
baud = device[CONF_DEVICE_BAUD]
|
||||||
controller = AlarmDecoder(SerialDevice(interface=path))
|
controller = AdExt(SerialDevice(interface=path))
|
||||||
elif device_type == "usb":
|
elif device_type == "usb":
|
||||||
AlarmDecoder(USBDevice.find())
|
AdExt(USBDevice.find())
|
||||||
return False
|
return False
|
||||||
|
|
||||||
controller.on_message += handle_message
|
controller.on_message += handle_message
|
||||||
|
@ -178,28 +178,27 @@ class AlarmDecoderAlarmPanel(AlarmControlPanelEntity):
|
|||||||
|
|
||||||
def alarm_arm_away(self, code=None):
|
def alarm_arm_away(self, code=None):
|
||||||
"""Send arm away command."""
|
"""Send arm away command."""
|
||||||
if code:
|
self.hass.data[DATA_AD].arm_away(
|
||||||
if self._auto_bypass:
|
code=code,
|
||||||
self.hass.data[DATA_AD].send(f"{code!s}6#")
|
code_arm_required=self._code_arm_required,
|
||||||
self.hass.data[DATA_AD].send(f"{code!s}2")
|
auto_bypass=self._auto_bypass,
|
||||||
elif not self._code_arm_required:
|
)
|
||||||
self.hass.data[DATA_AD].send("#2")
|
|
||||||
|
|
||||||
def alarm_arm_home(self, code=None):
|
def alarm_arm_home(self, code=None):
|
||||||
"""Send arm home command."""
|
"""Send arm home command."""
|
||||||
if code:
|
self.hass.data[DATA_AD].arm_home(
|
||||||
if self._auto_bypass:
|
code=code,
|
||||||
self.hass.data[DATA_AD].send(f"{code!s}6#")
|
code_arm_required=self._code_arm_required,
|
||||||
self.hass.data[DATA_AD].send(f"{code!s}3")
|
auto_bypass=self._auto_bypass,
|
||||||
elif not self._code_arm_required:
|
)
|
||||||
self.hass.data[DATA_AD].send("#3")
|
|
||||||
|
|
||||||
def alarm_arm_night(self, code=None):
|
def alarm_arm_night(self, code=None):
|
||||||
"""Send arm night command."""
|
"""Send arm night command."""
|
||||||
if code:
|
self.hass.data[DATA_AD].arm_night(
|
||||||
self.hass.data[DATA_AD].send(f"{code!s}7")
|
code=code,
|
||||||
elif not self._code_arm_required:
|
code_arm_required=self._code_arm_required,
|
||||||
self.hass.data[DATA_AD].send("#7")
|
auto_bypass=self._auto_bypass,
|
||||||
|
)
|
||||||
|
|
||||||
def alarm_toggle_chime(self, code=None):
|
def alarm_toggle_chime(self, code=None):
|
||||||
"""Send toggle chime command."""
|
"""Send toggle chime command."""
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
"domain": "alarmdecoder",
|
"domain": "alarmdecoder",
|
||||||
"name": "AlarmDecoder",
|
"name": "AlarmDecoder",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/alarmdecoder",
|
"documentation": "https://www.home-assistant.io/integrations/alarmdecoder",
|
||||||
"requirements": ["alarmdecoder==1.13.2"],
|
"requirements": ["adext==0.3"],
|
||||||
"codeowners": ["@ajschmidt8"]
|
"codeowners": ["@ajschmidt8"]
|
||||||
}
|
}
|
||||||
|
@ -131,6 +131,9 @@ adafruit-circuitpython-mcp230xx==2.2.2
|
|||||||
# homeassistant.components.androidtv
|
# homeassistant.components.androidtv
|
||||||
adb-shell==0.1.3
|
adb-shell==0.1.3
|
||||||
|
|
||||||
|
# homeassistant.components.alarmdecoder
|
||||||
|
adext==0.3
|
||||||
|
|
||||||
# homeassistant.components.adguard
|
# homeassistant.components.adguard
|
||||||
adguardhome==0.4.2
|
adguardhome==0.4.2
|
||||||
|
|
||||||
@ -235,9 +238,6 @@ airly==0.0.2
|
|||||||
# homeassistant.components.aladdin_connect
|
# homeassistant.components.aladdin_connect
|
||||||
aladdin_connect==0.3
|
aladdin_connect==0.3
|
||||||
|
|
||||||
# homeassistant.components.alarmdecoder
|
|
||||||
alarmdecoder==1.13.2
|
|
||||||
|
|
||||||
# homeassistant.components.alpha_vantage
|
# homeassistant.components.alpha_vantage
|
||||||
alpha_vantage==2.2.0
|
alpha_vantage==2.2.0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user