1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! A library that lets you use lm_sensor's sysfs interface from rust.
//!
//! Similar to libsensors this library lets you use the various sensors in your system.
//!
//! #Examples
//!
//! Print the temperature of all the temp sensors in your system:
//!
//! ```no_run
//! use libmedium::{
//! parse_hwmons,
//! sensors::sync_sensors::{temp::TempSensor, SyncSensor},
//! };
//!
//! let hwmons = parse_hwmons().unwrap();
//! for hwmon in &hwmons {
//! println!("hwmon{} with name {}:", hwmon.index(), hwmon.name());
//! for (_, temp_sensor) in hwmon.temps() {
//! let temperature = temp_sensor.read_input().unwrap();
//! println!("\t{}: {:?}", temp_sensor.name(), temperature);
//! }
//! }
//! ```
//!
//! Set the pwm value of all your pwm capable fans to full speed:
//!
//! ```no_run
//! use libmedium::{
//! parse_hwmons,
//! sensors::sync_sensors::pwm::WriteablePwmSensor,
//! units::{Pwm, PwmEnable},
//! };
//!
//! let hwmons = parse_hwmons().unwrap();
//! for hwmon in &hwmons {
//! for (_, pwm) in hwmon.writeable_pwms() {
//! pwm.write_enable(PwmEnable::ManualControl).unwrap();
//! pwm.write_pwm(Pwm::try_from_percent(100.0).unwrap()).unwrap();
//! }
//! }
//! ```
pub use Error as ParsingError;
/// Convenience function for [`hwmon::sync_hwmon::Hwmons::parse`](crate::hwmon::sync_hwmon::Hwmons::parse())
/// Convenience function for [`hwmon::async_hwmon::Hwmons::parse`](crate::hwmon::async_hwmon::Hwmons::parse())
pub async