aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs
index f28d2bd..64057a4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -863,6 +863,7 @@ pub async fn run<T: Transport>(device: &mut Device<'_>, transport: &mut T) -> Re
863 } 863 }
864 } 864 }
865 865
866 let mut first_iteration_push = true;
866 'outer_loop: loop { 867 'outer_loop: loop {
867 use core::fmt::Write; 868 use core::fmt::Write;
868 869
@@ -874,7 +875,7 @@ pub async fn run<T: Transport>(device: &mut Device<'_>, transport: &mut T) -> Re
874 None => break, 875 None => break,
875 }; 876 };
876 877
877 if !entity.publish { 878 if !entity.publish && !first_iteration_push {
878 continue; 879 continue;
879 } 880 }
880 881
@@ -920,10 +921,12 @@ pub async fn run<T: Transport>(device: &mut Device<'_>, transport: &mut T) -> Re
920 device.publish_buffer.truncate(n); 921 device.publish_buffer.truncate(n);
921 } 922 }
922 _ => { 923 _ => {
923 crate::log::warn!( 924 if !first_iteration_push {
924 "entity '{}' requested state publish but its storage does not support it", 925 crate::log::warn!(
925 entity.config.id 926 "entity '{}' requested state publish but its storage does not support it",
926 ); 927 entity.config.id
928 );
929 }
927 continue; 930 continue;
928 } 931 }
929 } 932 }
@@ -970,6 +973,7 @@ pub async fn run<T: Transport>(device: &mut Device<'_>, transport: &mut T) -> Re
970 } 973 }
971 } 974 }
972 } 975 }
976 first_iteration_push = false;
973 977
974 let receive = client.receive(); 978 let receive = client.receive();
975 let waker = wait_on_atomic_waker(device.waker); 979 let waker = wait_on_atomic_waker(device.waker);