mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Add Freebox Home alarm panel (#102607)
* add alarm control panel * optimize update node * Modify comment * move const to alarm * add alarm panel tests * tests modified * add file into coveragerc * Review: DATA_HOME_GET_VALUES -> DATA_HOME_PIR_GET_VALUES * Review: commands rename * Review: precise what "alarm2" is for features * Review: remove custom attributes & properties that exists in parent * Review: Avoid duplicates of async_write_ha_state() * make functions private * Review: initial state never works * Review: remove extra attrs * Review: fix tests * Fix tests * Remove line in .coveragerc --------- Co-authored-by: Quentame <polletquentin74@me.com>
This commit is contained in:
@@ -515,7 +515,7 @@ DATA_LAN_GET_HOSTS_LIST = [
|
||||
|
||||
# Home
|
||||
# PIR node id 26, endpoint id 6
|
||||
DATA_HOME_GET_VALUES = {
|
||||
DATA_HOME_PIR_GET_VALUES = {
|
||||
"category": "",
|
||||
"ep_type": "signal",
|
||||
"id": 6,
|
||||
@@ -527,6 +527,15 @@ DATA_HOME_GET_VALUES = {
|
||||
"visibility": "normal",
|
||||
}
|
||||
|
||||
# Home
|
||||
# ALARM node id 7, endpoint id 11
|
||||
DATA_HOME_ALARM_GET_VALUES = {
|
||||
"refresh": 2000,
|
||||
"value": "alarm2_armed",
|
||||
"value_type": "string",
|
||||
}
|
||||
|
||||
|
||||
# Home
|
||||
# ALL
|
||||
DATA_HOME_GET_NODES = [
|
||||
@@ -2526,4 +2535,354 @@ DATA_HOME_GET_NODES = [
|
||||
"inherit": "node::ios",
|
||||
},
|
||||
},
|
||||
{
|
||||
"adapter": 5,
|
||||
"category": "alarm",
|
||||
"group": {"label": ""},
|
||||
"id": 7,
|
||||
"label": "Système d'alarme",
|
||||
"name": "node_7",
|
||||
"props": {
|
||||
"Address": 3,
|
||||
"Challenge": "447599f5cab8620122b913e55faf8e1d",
|
||||
"FwVersion": 47396239,
|
||||
"Gateway": 1,
|
||||
"ItemId": "e515a55b04f32e6d",
|
||||
},
|
||||
"show_endpoints": [
|
||||
{
|
||||
"category": "",
|
||||
"ep_type": "slot",
|
||||
"id": 5,
|
||||
"label": "Code PIN",
|
||||
"name": "pin",
|
||||
"ui": {...},
|
||||
"value": "",
|
||||
"value_type": "string",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"category": "",
|
||||
"ep_type": "slot",
|
||||
"id": 6,
|
||||
"label": "Puissance des bips",
|
||||
"name": "sound",
|
||||
"ui": {...},
|
||||
"value": 0,
|
||||
"value_type": "int",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"category": "",
|
||||
"ep_type": "slot",
|
||||
"id": 7,
|
||||
"label": "Puissance de la sirène",
|
||||
"name": "volume",
|
||||
"ui": {...},
|
||||
"value": 0,
|
||||
"value_type": "int",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"category": "alarm",
|
||||
"ep_type": "slot",
|
||||
"id": 8,
|
||||
"label": "Délai avant armement",
|
||||
"name": "timeout1",
|
||||
"ui": {...},
|
||||
"value": 0,
|
||||
"value_type": "int",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"category": "alarm",
|
||||
"ep_type": "slot",
|
||||
"id": 9,
|
||||
"label": "Délai avant sirène",
|
||||
"name": "timeout2",
|
||||
"ui": {...},
|
||||
"value": 0,
|
||||
"value_type": "int",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"category": "alarm",
|
||||
"ep_type": "slot",
|
||||
"id": 10,
|
||||
"label": "Durée de la sirène",
|
||||
"name": "timeout3",
|
||||
"ui": {...},
|
||||
"value": 0,
|
||||
"value_type": "int",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"category": "",
|
||||
"ep_type": "signal",
|
||||
"id": 12,
|
||||
"label": "Code PIN",
|
||||
"name": "pin",
|
||||
"refresh": 2000,
|
||||
"ui": {...},
|
||||
"value": "0000",
|
||||
"value_type": "string",
|
||||
},
|
||||
{
|
||||
"category": "",
|
||||
"ep_type": "signal",
|
||||
"id": 14,
|
||||
"label": "Puissance des bips",
|
||||
"name": "sound",
|
||||
"refresh": 2000,
|
||||
"ui": {...},
|
||||
"value": 1,
|
||||
"value_type": "int",
|
||||
},
|
||||
{
|
||||
"category": "",
|
||||
"ep_type": "signal",
|
||||
"id": 15,
|
||||
"label": "Puissance de la sirène",
|
||||
"name": "volume",
|
||||
"refresh": 2000,
|
||||
"ui": {...},
|
||||
"value": 100,
|
||||
"value_type": "int",
|
||||
},
|
||||
{
|
||||
"category": "alarm",
|
||||
"ep_type": "signal",
|
||||
"id": 16,
|
||||
"label": "Délai avant armement",
|
||||
"name": "timeout1",
|
||||
"refresh": 2000,
|
||||
"ui": {...},
|
||||
"value": 15,
|
||||
"value_type": "int",
|
||||
},
|
||||
{
|
||||
"category": "alarm",
|
||||
"ep_type": "signal",
|
||||
"id": 17,
|
||||
"label": "Délai avant sirène",
|
||||
"name": "timeout2",
|
||||
"refresh": 2000,
|
||||
"ui": {...},
|
||||
"value": 15,
|
||||
"value_type": "int",
|
||||
},
|
||||
{
|
||||
"category": "alarm",
|
||||
"ep_type": "signal",
|
||||
"id": 18,
|
||||
"label": "Durée de la sirène",
|
||||
"name": "timeout3",
|
||||
"refresh": 2000,
|
||||
"ui": {...},
|
||||
"value": 300,
|
||||
"value_type": "int",
|
||||
},
|
||||
{
|
||||
"category": "",
|
||||
"ep_type": "signal",
|
||||
"id": 19,
|
||||
"label": "Niveau de Batterie",
|
||||
"name": "battery",
|
||||
"refresh": 2000,
|
||||
"ui": {...},
|
||||
"value": 85,
|
||||
"value_type": "int",
|
||||
},
|
||||
],
|
||||
"type": {
|
||||
"abstract": False,
|
||||
"endpoints": [
|
||||
{
|
||||
"ep_type": "slot",
|
||||
"id": 0,
|
||||
"label": "Trigger",
|
||||
"name": "trigger",
|
||||
"value_type": "void",
|
||||
"visibility": "internal",
|
||||
},
|
||||
{
|
||||
"ep_type": "slot",
|
||||
"id": 1,
|
||||
"label": "Alarme principale",
|
||||
"name": "alarm1",
|
||||
"value_type": "void",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"ep_type": "slot",
|
||||
"id": 2,
|
||||
"label": "Alarme secondaire",
|
||||
"name": "alarm2",
|
||||
"value_type": "void",
|
||||
"visibility": "internal",
|
||||
},
|
||||
{
|
||||
"ep_type": "slot",
|
||||
"id": 3,
|
||||
"label": "Passer le délai",
|
||||
"name": "skip",
|
||||
"value_type": "void",
|
||||
"visibility": "internal",
|
||||
},
|
||||
{
|
||||
"ep_type": "slot",
|
||||
"id": 4,
|
||||
"label": "Désactiver l'alarme",
|
||||
"name": "off",
|
||||
"value_type": "void",
|
||||
"visibility": "internal",
|
||||
},
|
||||
{
|
||||
"ep_type": "slot",
|
||||
"id": 5,
|
||||
"label": "Code PIN",
|
||||
"name": "pin",
|
||||
"value_type": "string",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"ep_type": "slot",
|
||||
"id": 6,
|
||||
"label": "Puissance des bips",
|
||||
"name": "sound",
|
||||
"value_type": "int",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"ep_type": "slot",
|
||||
"id": 7,
|
||||
"label": "Puissance de la sirène",
|
||||
"name": "volume",
|
||||
"value_type": "int",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"ep_type": "slot",
|
||||
"id": 8,
|
||||
"label": "Délai avant armement",
|
||||
"name": "timeout1",
|
||||
"value_type": "int",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"ep_type": "slot",
|
||||
"id": 9,
|
||||
"label": "Délai avant sirène",
|
||||
"name": "timeout2",
|
||||
"value_type": "int",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"ep_type": "slot",
|
||||
"id": 10,
|
||||
"label": "Durée de la sirène",
|
||||
"name": "timeout3",
|
||||
"value_type": "int",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"ep_type": "signal",
|
||||
"id": 11,
|
||||
"label": "État de l'alarme",
|
||||
"name": "state",
|
||||
"param_type": "void",
|
||||
"value_type": "string",
|
||||
"visibility": "internal",
|
||||
},
|
||||
{
|
||||
"ep_type": "signal",
|
||||
"id": 12,
|
||||
"label": "Code PIN",
|
||||
"name": "pin",
|
||||
"param_type": "void",
|
||||
"value_type": "string",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"ep_type": "signal",
|
||||
"id": 13,
|
||||
"label": "Erreur",
|
||||
"name": "error",
|
||||
"param_type": "void",
|
||||
"value_type": "string",
|
||||
"visibility": "internal",
|
||||
},
|
||||
{
|
||||
"ep_type": "signal",
|
||||
"id": 14,
|
||||
"label": "Puissance des bips",
|
||||
"name": "sound",
|
||||
"param_type": "void",
|
||||
"value_type": "int",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"ep_type": "signal",
|
||||
"id": 15,
|
||||
"label": "Puissance de la sirène",
|
||||
"name": "volume",
|
||||
"param_type": "void",
|
||||
"value_type": "int",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"ep_type": "signal",
|
||||
"id": 16,
|
||||
"label": "Délai avant armement",
|
||||
"name": "timeout1",
|
||||
"param_type": "void",
|
||||
"value_type": "int",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"ep_type": "signal",
|
||||
"id": 17,
|
||||
"label": "Délai avant sirène",
|
||||
"name": "timeout2",
|
||||
"param_type": "void",
|
||||
"value_type": "int",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"ep_type": "signal",
|
||||
"id": 18,
|
||||
"label": "Durée de la sirène",
|
||||
"name": "timeout3",
|
||||
"param_type": "void",
|
||||
"value_type": "int",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"ep_type": "signal",
|
||||
"id": 19,
|
||||
"label": "Niveau de Batterie",
|
||||
"name": "battery",
|
||||
"param_type": "void",
|
||||
"value_type": "int",
|
||||
"visibility": "normal",
|
||||
},
|
||||
{
|
||||
"ep_type": "signal",
|
||||
"id": 20,
|
||||
"label": "Batterie faible",
|
||||
"name": "battery_warning",
|
||||
"param_type": "void",
|
||||
"value_type": "int",
|
||||
"visibility": "normal",
|
||||
},
|
||||
],
|
||||
"generic": False,
|
||||
"icon": "/resources/images/home/pictos/alarm_system.png",
|
||||
"inherit": "node::domus",
|
||||
"label": "Système d'alarme",
|
||||
"name": "node::domus::freebox::secmod",
|
||||
"params": {},
|
||||
"physical": True,
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user