Skip to main content

RointeClient

Struct RointeClient 

Source
pub struct RointeClient { /* private fields */ }
Expand description

High-level API for authenticating, discovering, and controlling Rointe devices.

All methods are async and require a Tokio runtime. Create an instance with RointeClient::new and reuse it across requests — it maintains an internal HTTP connection pool and handles token refresh automatically.

Implementations§

Source§

impl RointeClient

Source

pub async fn new(email: &str, password: &str) -> Result<Self>

Authenticate with Rointe / Firebase and return a ready client.

§Example
let client = RointeClient::new("user@example.com", "s3cr3t").await?;
Source

pub async fn get_installations(&self) -> Result<Vec<Installation>>

Return all installations belonging to the authenticated user.

§Example
let installations = client.get_installations().await?;
for inst in &installations {
    println!("{}: {}", inst.id, inst.name.as_deref().unwrap_or("—"));
}
Source

pub async fn discover_devices( &self, installation_id: &str, ) -> Result<Vec<String>>

Return all device IDs found within an installation (recurses through zones).

§Example
let device_ids = client.discover_devices("installation-id").await?;
println!("Found {} device(s)", device_ids.len());
Source

pub async fn get_device(&self, device_id: &str) -> Result<RointeDevice>

Fetch the current state of a single device.

§Example
let device = client.get_device("device-id").await?;
println!("{}: {:.1}°C ({})", device.data.name, device.data.temp,
    if device.data.power { "ON" } else { "OFF" });
Source

pub async fn set_temperature(&self, device_id: &str, temp: f64) -> Result<()>

Set the target temperature (switches to manual mode, powers on).

§Example
client.set_temperature("device-id", 21.5).await?;
Source

pub async fn set_preset(&self, device_id: &str, preset: Preset) -> Result<()>

Activate a comfort preset (comfort / eco / ice).

§Example
client.set_preset("device-id", Preset::Eco).await?;
Source

pub async fn set_mode(&self, device_id: &str, mode: HvacMode) -> Result<()>

Set the HVAC operating mode.

§Example
client.set_mode("device-id", HvacMode::Auto).await?;
Source

pub async fn get_energy_stats( &self, device_id: &str, ) -> Result<EnergyConsumptionData>

Return the most recent hourly energy stats for a device.

Tries the current hour and walks back up to 5 hours to find a non-null record. Returns an empty EnergyConsumptionData if no data is found (not all device models report energy statistics).

§Example
let stats = client.get_energy_stats("device-id").await?;
if let Some(kwh) = stats.kw_h {
    println!("Last hour: {kwh:.3} kWh");
}

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more