dectmngr: add rules in ruleng to handle DECT LED

Also remove the default DECT PIN '1234'.
This commit is contained in:
George Yang 2025-05-08 11:59:08 +00:00 committed by IOPSYS Dev
parent 075728ce3e
commit 5f36441b11
No known key found for this signature in database
3 changed files with 90 additions and 1 deletions

View file

@ -4,4 +4,3 @@ config dect 'global'
config dect 'base'
option enable '1'
option PIN '1234'

View file

@ -0,0 +1,88 @@
{
"dect_registration_started": {
"if": [
{
"event": "dect.base",
"match": {
"event": "registration",
"status": "started"
}
}
],
"then": [
{
"object": "led.dect",
"method": "set",
"args": {
"state": "notice",
"timeout": 120
},
"timeout": 1
}
]
},
"dect_registration_stopped": {
"if": [
{
"event": "dect.base",
"match": {
"event": "registration",
"status": "stopped"
}
}
],
"then": [
{
"object": "led.dect",
"method": "set",
"args": {
"state": "off"
},
"timeout": 1
}
]
},
"dect_registration_timeout": {
"if": [
{
"event": "dect.base",
"match": {
"event": "registration",
"status": "timeout"
}
}
],
"then": [
{
"object": "led.dect",
"method": "set",
"args": {
"state": "off"
},
"timeout": 1
}
]
},
"dect_registration_success": {
"if": [
{
"event": "dect.base",
"match": {
"event": "registration",
"status": "success"
}
}
],
"then": [
{
"object": "led.dect",
"method": "set",
"args": {
"state": "ok",
"timeout": 5
},
"timeout": 1
}
]
}
}

View file

@ -0,0 +1,2 @@
uci -q set ruleng.dect=rule
uci -q set ruleng.dect.recipe='/etc/ruleng/dect.json'