Flushes the button's image to the device
(&self)
| 458 | |
| 459 | /// Flushes the button's image to the device |
| 460 | pub fn flush(&self) -> Result<(), StreamDeckError> { |
| 461 | if self.image_cache.read()?.is_empty() { |
| 462 | return Ok(()); |
| 463 | } |
| 464 | |
| 465 | for image in self.image_cache.read()?.iter() { |
| 466 | self.send_image(image.key, &image.image_data)?; |
| 467 | } |
| 468 | |
| 469 | self.image_cache.write()?.clear(); |
| 470 | |
| 471 | Ok(()) |
| 472 | } |
| 473 | |
| 474 | /// Returns button state reader for this device |
| 475 | pub fn get_reader(self: &Arc<Self>) -> Arc<DeviceStateReader> { |
no test coverage detected