private void PublishZoneState(clsZone zone) { MqttClient.PublishAsync(zone.ToTopic(Topic.state), zone.ToState(), MqttQualityOfServiceLevel.AtMostOnce, true); MqttClient.PublishAsync(zone.ToTopic(Topic.basic_state), zone.ToBasicState(), MqttQualityOfServiceLevel.AtMostOnce, true); if (zone.IsTemperatureZone()) { MqttClient.PublishAsync(zone.ToTopic(Topic.current_temperature), zone.TempText(), MqttQualityOfServiceLevel.AtMostOnce, true); } else if (zone.IsHumidityZone()) { MqttClient.PublishAsync(zone.ToTopic(Topic.current_humidity), zone.TempText(), MqttQualityOfServiceLevel.AtMostOnce, true); } }
private void PublishZoneState(clsZone zone) { PublishAsync(zone.ToTopic(Topic.state), zone.ToState()); PublishAsync(zone.ToTopic(Topic.basic_state), zone.ToBasicState()); if (zone.IsTemperatureZone()) { PublishAsync(zone.ToTopic(Topic.current_temperature), zone.TempText()); } else if (zone.IsHumidityZone()) { PublishAsync(zone.ToTopic(Topic.current_humidity), zone.TempText()); } }