ClementNerma / tapo-rest

An unofficial REST API to remotely control Tapo devices
28 stars 3 forks source link

compile error on raspbian #6

Closed kafeenstra closed 4 months ago

kafeenstra commented 5 months ago

On a Raspbian GNU/Linux 10 raspberry pi, with a new install of rust, I get:

error[E0599]: no method named `with_context` found for struct `ApiClient` in the current scope
  --> src/devices.rs:46:14
   |
45 |   ...   let tapo_client = ApiClient::new(username, password)
   |  _________________________-
46 | | ...       .with_context(|| format!("Failed to connect to Tapo device '...
   | |           -^^^^^^^^^^^^ method not found in `ApiClient`
   | |___________|
   | 

warning: unused import: `Context`
 --> src/devices.rs:1:14
  |
1 | use anyhow::{Context, Result};
  |              ^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

For more information about this error, try `rustc --explain E0599`.
warning: `tapo-rest` (bin "tapo-rest") generated 1 warning
error: could not compile `tapo-rest` (bin "tapo-rest") due to 1 previous error; 1 warning emitted

I installed rust using: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

The command to install tapo-rest was according to the instructions: cargo install --git https://github.com/ClementNerma/tapo-rest

Any idea where to start fixing this?

ClementNerma commented 5 months ago

I just fixed the problem, turns out it was because the new minor version from the Tapo API made a breaking change, so building failed because of that.

You can try again, it should work properly now :)