Skip to content

Commit

Permalink
feat: IR-emitter entity
Browse files Browse the repository at this point in the history
Other changes:
- add Copy to simple enums
  • Loading branch information
zehnm committed Aug 16, 2024
1 parent a9f6780 commit 93c8294
Show file tree
Hide file tree
Showing 7 changed files with 152 additions and 58 deletions.
44 changes: 41 additions & 3 deletions src/core/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use strum_macros::{AsRefStr, Display, EnumString, VariantNames};
///
/// Attention: only valid in the Core-API data model. See [crate::intg::IntgRemoteOptionField]
/// for the Integration-API data model.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(AsRefStr, Display, EnumString, VariantNames)] // strum_macros
#[strum(serialize_all = "snake_case")]
Expand All @@ -28,7 +28,7 @@ pub enum RemoteOptionField {
///
/// Attention: only valid in the Core-API data model. See [crate::intg::IntgRemoteFeature]
/// for the Integration-API data model.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(AsRefStr, Display, EnumString, VariantNames)] // strum_macros
#[strum(serialize_all = "snake_case")]
Expand All @@ -49,7 +49,7 @@ pub enum RemoteFeature {
///
/// Attention: only valid in the Core-API data model. See [crate::intg::IntgRemoteCommand]
/// for the Integration-API data model.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(AsRefStr, Display, EnumString, VariantNames)] // strum_macros
#[strum(serialize_all = "snake_case")]
Expand All @@ -64,3 +64,41 @@ pub enum RemoteCommand {
SendCmdSequence,
SendKey,
}

/// Core-API IR-emitter features.
///
/// Attention: only valid in the Core-API data model. See [crate::intg::IntgIrEmitterFeature]
/// for the Integration-API data model.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(AsRefStr, Display, EnumString, VariantNames)] // strum_macros
#[strum(serialize_all = "snake_case")]
pub enum IrEmitterFeature {
SendIr,
}

/// Core-API IR-emitter entity commands.
///
/// Attention: only valid in the Core-API data model. See [crate::intg::IntgIrEmitterCommand]
/// for the Integration-API data model.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(AsRefStr, Display, EnumString, VariantNames)] // strum_macros
#[strum(serialize_all = "snake_case")]
pub enum IrEmitterCommand {
SendIr,
StopIr,
}

/// Core-API IR-emitter entity option fields.
///
/// Attention: only valid in the Core-API data model. See [crate::intg::IntgIrEmitterOptionField]
/// for the Integration-API data model.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(AsRefStr, Display, EnumString, VariantNames)] // strum_macros
#[strum(serialize_all = "snake_case")]
pub enum IrEmitterOptionField {
Ports,
IrFormats,
}
Loading

0 comments on commit 93c8294

Please sign in to comment.