Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The following table lists the software IDs and device/board combinations that ha
| 469 | W 487 S | EDPW 228-A | Mitsubishi M38078MF | *Check inlet (PC)* indicator | 🟢 Fully supported |
| 605 | G 651 I PLUS-3 | EGPL 542-C | Mitsubishi M38027M8 | *Salt (PC)* indicator | 🟢 Fully supported |
| 629 | W 2446 | EDPL 126-B | Mitsubishi M38079MF-308FP | *Check inlet (PC)* indicator | 🟢 Fully supported |
| 1998 | W 627 F | ELP 165-T | Renesas M3062LFGPFP | *(PC)* indicator | 🟢 Fully supported |
| 2088 | W 3241 | EDPL 162-B | Mitsubishi M38079EFFP | *Check inlet (PC)* indicator | 🟢 Fully supported |

If your appliance is not listed here but has a model number similar to one of the above, it might already be compatible. In all other cases, determining the **software ID** is the first step toward adding support for new devices.
Expand Down
17 changes: 16 additions & 1 deletion protocol/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
//! Use the [`connect`] function to automatically select the correct device
//! implementation based on the devices's software ID.

pub mod common;
pub mod id1998;
pub mod id2088;
pub mod id324;
pub mod id360;
Expand All @@ -21,7 +23,7 @@ use crate::{Error as ProtocolError, Interface, Read, Write};
use alloc::{boxed::Box, string::String};
use core::{
fmt::{Display, Formatter},
num::TryFromIntError,
num::{ParseIntError, TryFromIntError},
time::Duration,
};

Expand Down Expand Up @@ -82,6 +84,12 @@ impl<E> From<TryFromIntError> for Error<E> {
}
}

impl<E> From<ParseIntError> for Error<E> {
fn from(_err: ParseIntError) -> Self {
Self::InvalidArgument
}
}

impl<E> From<bitflags::parser::ParseError> for Error<E> {
fn from(_err: bitflags::parser::ParseError) -> Self {
Self::InvalidArgument
Expand Down Expand Up @@ -166,6 +174,10 @@ pub enum ActionParameters {
///
/// The slice contains all possible flag names.
Flags(&'static [&'static str]),
/// Action accepts a value within an integer range.
///
/// The range is limited by a minium and maximum value (inclusive).
Range(u32, u32),
}

/// A device action, e.g. starting the current washing program.
Expand Down Expand Up @@ -455,6 +467,9 @@ pub async fn connect<'a, P: 'a + Read + Write>(
id629::compatible_software_ids!() => {
Ok(Box::new(id629::WashingMachine::initialize(intf, id).await?) as Box<dyn Device<P>>)
}
id1998::compatible_software_ids!() => {
Ok(Box::new(id1998::WashingMachine::initialize(intf, id).await?) as Box<dyn Device<P>>)
}
id2088::compatible_software_ids!() => {
Ok(Box::new(id2088::WashingMachine::initialize(intf, id).await?) as Box<dyn Device<P>>)
}
Expand Down
Loading
Loading