Add Config Flow to AlarmDecoder (#37998)

This commit is contained in:
AJ Schmidt 2020-09-13 13:29:25 -04:00 committed by GitHub
parent 17efa1bda5
commit c32f698671
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 1169 additions and 210 deletions

View file

@ -1,26 +1,29 @@
"""Support for AlarmDecoder sensors (Shows Panel Display)."""
import logging
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.typing import HomeAssistantType
from . import SIGNAL_PANEL_MESSAGE
from .const import SIGNAL_PANEL_MESSAGE
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up for AlarmDecoder sensor devices."""
_LOGGER.debug("AlarmDecoderSensor: setup_platform")
async def async_setup_entry(
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities
):
"""Set up for AlarmDecoder sensor."""
device = AlarmDecoderSensor(hass)
add_entities([device])
entity = AlarmDecoderSensor()
async_add_entities([entity])
return True
class AlarmDecoderSensor(Entity):
"""Representation of an AlarmDecoder keypad."""
def __init__(self, hass):
def __init__(self):
"""Initialize the alarm panel."""
self._display = ""
self._state = None