diff options
Diffstat (limited to 'src/command_policy.rs')
| -rw-r--r-- | src/command_policy.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/command_policy.rs b/src/command_policy.rs index 049d56a..e5859bb 100644 --- a/src/command_policy.rs +++ b/src/command_policy.rs | |||
| @@ -64,16 +64,13 @@ | |||
| 64 | /// # async fn turn_on_motor() -> Result<(), ()> { Ok(()) } | 64 | /// # async fn turn_on_motor() -> Result<(), ()> { Ok(()) } |
| 65 | /// ``` | 65 | /// ``` |
| 66 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] | 66 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
| 67 | #[derive(Default)] | ||
| 67 | pub enum CommandPolicy { | 68 | pub enum CommandPolicy { |
| 68 | /// Automatically publish the entity's state when a command is received. | 69 | /// Automatically publish the entity's state when a command is received. |
| 70 | #[default] | ||
| 69 | PublishState, | 71 | PublishState, |
| 70 | 72 | ||
| 71 | /// Do not automatically publish state. The application must manually update the state. | 73 | /// Do not automatically publish state. The application must manually update the state. |
| 72 | Manual, | 74 | Manual, |
| 73 | } | 75 | } |
| 74 | 76 | ||
| 75 | impl Default for CommandPolicy { | ||
| 76 | fn default() -> Self { | ||
| 77 | Self::PublishState | ||
| 78 | } | ||
| 79 | } | ||
