minor lifeline changes

This commit is contained in:
Ariel Sosnovsky committed 2023-11-02 12:40:37 -04:00
1 parent de66de832e
commit 80b8ea92c2
3 files changed
+19 -11

No files matched your search

+11 -6
View File
@@ -98,7 +98,8 @@ var ENTITIES = {
expire_after: 5,
name: "Flichub Connected",
device_class: "connectivity",
unit_of_measurement: "s"
unit_of_measurement: "s",
payload_not_available: "OFF"
}
],
connected: [
@@ -107,7 +108,8 @@ var ENTITIES = {
entity_category: "diagnostic",
expire_after: 5,
device_class: "connectivity",
name: "Connection Established"
name: "Connection Established",
payload_not_available: "OFF"
}
],
ready: [
@@ -165,12 +167,12 @@ function makeButtonController(ha, buttonModule) {
availability: [
{
payload_available: "ON",
payload_not_available: "OFF",
payload_not_available: "unavailable",
topic: ha.genFlicPrefix(genButtonUniqueId(button.bdaddr), "ready")
},
{
payload_available: "ON",
payload_not_available: "OFF",
payload_not_available: "unavailable",
topic: ha.genFlicPrefix(genButtonUniqueId(button.bdaddr), "lifeline")
}
],
@@ -452,7 +454,7 @@ var makeIRController = function(ir, ha, mqtt) {
var availability = [
{
payload_available: "ON",
payload_not_available: "OFF",
payload_not_available: "unavailable",
topic: LIFELINE_SGINAL
}
];
@@ -470,7 +472,10 @@ var makeIRController = function(ir, ha, mqtt) {
ha.registerEntity("IR Available", "binary_sensor", nodeId, "lifeline", haDevice, {
device_class: "connectivity",
expire_after: 5,
entity_category: "diagnostic"
off_delay: 3,
entity_category: "diagnostic",
payload_available: "ON",
payload_not_available: "OFF"
});
ha.registerEntity("Record Signal", "switch", nodeId, "record", haDevice, {
icon: "mdi:record-rec",
+4 -4
View File
@@ -17,8 +17,8 @@ const ENTITIES: Record<string, [HAComponent, Record<string, any>]> = {
"state": ['sensor', { icon: 'mdi:radiobox-indeterminate-variant' }],
"battery": ['sensor', { expire_after: 5, unit_of_measurement: '%', device_class: 'battery' }],
"batteryLastUpdate": ['sensor', { entity_category: "diagnostic", expire_after: 5, name: "Battery Last Update Time", device_class: "duration", unit_of_measurement: "s" }],
"lifeline": ['binary_sensor', { entity_category: "diagnostic", expire_after: 5, name: "Flichub Connected", device_class: "connectivity", unit_of_measurement: "s" }],
"connected": ['binary_sensor', { entity_category: "diagnostic", expire_after: 5, device_class: 'connectivity', name: "Connection Established" }],
"lifeline": ['binary_sensor', { entity_category: "diagnostic", expire_after: 5, name: "Flichub Connected", device_class: "connectivity", unit_of_measurement: "s", payload_not_available: "OFF" }],
"connected": ['binary_sensor', { entity_category: "diagnostic", expire_after: 5, device_class: 'connectivity', name: "Connection Established", payload_not_available: "OFF" }],
"ready": ['binary_sensor', { entity_category: "config", expire_after: 5, device_class: 'connectivity', name: "Connection Verified" }],
"activeDisconnect": ['binary_sensor', { entity_category: "config", expire_after: 5, name: "User Active Disconnect" }],
"passive": ['binary_sensor', { entity_category: "config", expire_after: 5, name: "Passive Mode" }],
@@ -52,12 +52,12 @@ export function makeButtonController(
availability: [
{
payload_available: 'ON',
payload_not_available: 'OFF',
payload_not_available: 'unavailable',
topic: ha.genFlicPrefix(genButtonUniqueId(button.bdaddr), 'ready')
},
{
payload_available: 'ON',
payload_not_available: 'OFF',
payload_not_available: 'unavailable',
topic: ha.genFlicPrefix(genButtonUniqueId(button.bdaddr), 'lifeline')
},
],
+4 -1
View File
@@ -47,7 +47,7 @@ export const makeIRController = (
const availability = [
{
"payload_available": "ON",
"payload_not_available": "OFF",
"payload_not_available": "unavailable",
"topic": LIFELINE_SGINAL,
}
]
@@ -73,7 +73,10 @@ export const makeIRController = (
{
device_class: 'connectivity',
expire_after: 5,
off_delay: 3,
entity_category: "diagnostic",
payload_available: "ON",
payload_not_available: "OFF",
}
)
ha.registerEntity(