mirror of
https://bitbucket.org/myhomie/mycorerepository.git
synced 2025-12-06 01:31:19 +00:00
MC add wakeup message handle + ok if config event
This commit is contained in:
parent
d69799eb7e
commit
7a6e2b1540
@ -78,18 +78,20 @@ namespace Mqtt.Client.AspNetCore.Services
|
||||
// if wakeup => Not drop wakeup message
|
||||
try
|
||||
{
|
||||
var deserialzed = JsonConvert.DeserializeObject<Dictionary<string, object>>(payload);
|
||||
var deserialized = JsonConvert.DeserializeObject<Dictionary<string, object>>(payload);
|
||||
|
||||
if (deserialzed != null) {
|
||||
isWakeUpMessage = (string)deserialzed["action"] == "wakeup";
|
||||
if (deserialized != null) {
|
||||
isWakeUpMessage = (string)deserialized["action"] == "wakeup";
|
||||
}
|
||||
} catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
var configMessage = topic == "zigbee2mqtt/bridge/event";
|
||||
|
||||
// Less than one second between two messages from a same device
|
||||
if (!(lastTopic == topic && test <= 500))
|
||||
if (!(lastTopic == topic && test <= 500) || configMessage)
|
||||
{
|
||||
if (_actionService != null)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user