diff options
author | Matthias Beyer <matthias.beyer@ifm.com> | 2022-05-18 15:21:13 +0200 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@ifm.com> | 2022-05-23 12:17:59 +0200 |
commit | 6f2bb0b3422e2fc9d1740bba780d79b0474816b0 (patch) | |
tree | 509be0d7254f18e910ed61d618f1c69fb64e9121 | |
parent | 45a5d36b3a13330f5c4df40b867dee9c57a5546d (diff) |
plugin_avg: Change config type to use typed address configuration
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
-rw-r--r-- | plugins/plugin_avg/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/plugin_avg/src/lib.rs b/plugins/plugin_avg/src/lib.rs index d777511b..bc5f567c 100644 --- a/plugins/plugin_avg/src/lib.rs +++ b/plugins/plugin_avg/src/lib.rs @@ -27,7 +27,7 @@ struct AvgConfig { timeframe: tedge_lib::config::Humantime, /// The name of the plugin to send the result to - target: String, + target: tedge_lib::config::Address, /// Whether to report a 0 (zero) if there are zero measurements in the timeframe report_on_zero_elements: bool, @@ -72,7 +72,7 @@ impl<PD: PluginDirectory> PluginBuilder<PD> for AvgPluginBuilder { ) -> Result<tedge_api::plugin::BuiltPlugin, PluginError> { let config = config.try_into::<AvgConfig>().map_err(Error::from)?; - let address = plugin_dir.get_address_for::<MeasurementReceiver>(&config.target)?; + let address = config.target.build(plugin_dir)?; Ok(AvgPlugin::new(address, config).finish()) } |