mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 13:57:10 +00:00
Adding ignore capability to Egardia component (#9676)
This commit is contained in:
parent
4be91a103d
commit
7759ae26fd
@ -25,6 +25,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
CONF_REPORT_SERVER_CODES = 'report_server_codes'
|
CONF_REPORT_SERVER_CODES = 'report_server_codes'
|
||||||
CONF_REPORT_SERVER_ENABLED = 'report_server_enabled'
|
CONF_REPORT_SERVER_ENABLED = 'report_server_enabled'
|
||||||
CONF_REPORT_SERVER_PORT = 'report_server_port'
|
CONF_REPORT_SERVER_PORT = 'report_server_port'
|
||||||
|
CONF_REPORT_SERVER_CODES_IGNORE = 'ignore'
|
||||||
|
|
||||||
DEFAULT_NAME = 'Egardia'
|
DEFAULT_NAME = 'Egardia'
|
||||||
DEFAULT_PORT = 80
|
DEFAULT_PORT = 80
|
||||||
@ -148,9 +149,15 @@ class EgardiaAlarm(alarm.AlarmControlPanel):
|
|||||||
|
|
||||||
def parsestatus(self, status):
|
def parsestatus(self, status):
|
||||||
"""Parse the status."""
|
"""Parse the status."""
|
||||||
|
_LOGGER.debug("Parsing status %s", status)
|
||||||
|
# Ignore the statuscode if it is IGNORE
|
||||||
|
if status.lower().strip() != CONF_REPORT_SERVER_CODES_IGNORE:
|
||||||
|
_LOGGER.debug("Not ignoring status")
|
||||||
newstatus = ([v for k, v in STATES.items()
|
newstatus = ([v for k, v in STATES.items()
|
||||||
if status.upper() == k][0])
|
if status.upper() == k][0])
|
||||||
self._status = newstatus
|
self._status = newstatus
|
||||||
|
else:
|
||||||
|
_LOGGER.error("Ignoring status")
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Update the alarm status."""
|
"""Update the alarm status."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user