| 357 | } |
| 358 | |
| 359 | async fn status_event( |
| 360 | &self, |
| 361 | _vars: &HashMap<String, String>, |
| 362 | pl: &integration::StatusEvent, |
| 363 | ) -> Result<()> { |
| 364 | let dev_info = pl |
| 365 | .device_info |
| 366 | .as_ref() |
| 367 | .ok_or_else(|| anyhow!("device_info is None"))?; |
| 368 | |
| 369 | let topic = self.get_event_topic(&dev_info.application_id, &dev_info.dev_eui, "status")?; |
| 370 | let b = match self.json { |
| 371 | true => serde_json::to_vec(&pl)?, |
| 372 | false => pl.encode_to_vec(), |
| 373 | }; |
| 374 | |
| 375 | self.publish_event(&topic, b).await |
| 376 | } |
| 377 | |
| 378 | async fn location_event( |
| 379 | &self, |