-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
panic on missing pressureunit #6
Comments
Hi @theHausdorffMetric, thanks for using my create. I haven't looked into it yet, before I do, just one questions: Do the other examples work for you? If not, it might be due to authorization. If yes, it might be that Netatmo changed the response or something else broke in my parser. |
I've just added logging right before the location I suspect your panic to occur. Can please rerun your example from the current master and prepend |
Hi @lukaspustina, Below is the current ouput (I DELETED some confidential stuff as you suggested) Finished dev [unoptimized + debuginfo] target(s) in 0.07s failed to deserialize JSON }', examples/get_station_data.rs:38:10 |
So it seems your device is sending slightly different Administrative information compared to mine. The crate so far expects this: #[derive(Debug, Serialize, Deserialize)]
pub struct Administrative {
pub feel_like_algo: u64,
pub lang: String,
pub pressureunit: u64,
pub reg_locale: String,
pub unit: u64,
pub windunit: u64,
} I don't see a reason to force these information. I will make The only concern I have here is that this is going to break the API and other users might get affected. But I will need to push a new create version anyway, so I'll make a minor increment. Please give a few days to change the code. |
@theHausdorffMetric Please check my changes on master. If it works, can you check all other examples too? Maybe we can surface other misplaced requirements, too. |
can now confirm that get_measure and get_station_data work as intended. |
Great. I'll push a new crate version later. |
Please see https://crates.io/crates/netatmo-rs/0.5.0. If this works for you, please close the issue. |
Thx for the support. |
Thx for the nice work. On example get_station_data I get
Finished dev [unoptimized + debuginfo] target(s) in 0.07s
Running
target/debug/examples/get_station_data
thread 'main' panicked at 'Failed to get station data: Error { inner: Error("missing field
pressureunit
", line: 1, column: 1393)failed to deserialize JSON }', examples/get_station_data.rs:36:10
note: run with
RUST_BACKTRACE=1
environment variable to display a backtraceLooking into it (however rust newbie)
The text was updated successfully, but these errors were encountered: