mirror of
https://github.com/excaliburpartners/OmniLinkBridge
synced 2024-12-22 18:52:24 +00:00
Fix system trouble naming and discovery payloads
This commit is contained in:
parent
b5298a1e74
commit
5cd6048dd5
|
@ -27,5 +27,11 @@ namespace OmniLinkBridge.MQTT
|
||||||
|
|
||||||
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public string value_template { get; set; }
|
public string value_template { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
||||||
|
public string payload_off { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
||||||
|
public string payload_on { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,7 +187,7 @@ namespace OmniLinkBridge.Modules
|
||||||
PublishAsync(SystemTroubleTopic("phone"), OmniLink.TroublePhone ? "trouble" : "secure");
|
PublishAsync(SystemTroubleTopic("phone"), OmniLink.TroublePhone ? "trouble" : "secure");
|
||||||
PublishAsync(SystemTroubleTopic("ac"), OmniLink.TroubleAC ? "trouble" : "secure");
|
PublishAsync(SystemTroubleTopic("ac"), OmniLink.TroubleAC ? "trouble" : "secure");
|
||||||
PublishAsync(SystemTroubleTopic("battery"), OmniLink.TroubleBattery ? "trouble" : "secure");
|
PublishAsync(SystemTroubleTopic("battery"), OmniLink.TroubleBattery ? "trouble" : "secure");
|
||||||
PublishAsync(SystemTroubleTopic("dcn"), OmniLink.TroubleDCM ? "trouble" : "secure");
|
PublishAsync(SystemTroubleTopic("dcm"), OmniLink.TroubleDCM ? "trouble" : "secure");
|
||||||
}
|
}
|
||||||
|
|
||||||
public string SystemTroubleTopic(string type)
|
public string SystemTroubleTopic(string type)
|
||||||
|
@ -202,7 +202,9 @@ namespace OmniLinkBridge.Modules
|
||||||
unique_id = $"{Global.mqtt_prefix}system{type}",
|
unique_id = $"{Global.mqtt_prefix}system{type}",
|
||||||
name = $"{Global.mqtt_discovery_name_prefix}System {name}",
|
name = $"{Global.mqtt_discovery_name_prefix}System {name}",
|
||||||
state_topic = SystemTroubleTopic(type),
|
state_topic = SystemTroubleTopic(type),
|
||||||
device_class = BinarySensor.DeviceClass.problem
|
device_class = BinarySensor.DeviceClass.problem,
|
||||||
|
payload_off = "secure",
|
||||||
|
payload_on = "trouble"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue