Skip to content
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

Devices are not discovered on local network #1

Open
ryanhossain9797 opened this issue Jul 17, 2022 · 1 comment
Open

Devices are not discovered on local network #1

ryanhossain9797 opened this issue Jul 17, 2022 · 1 comment

Comments

@ryanhossain9797
Copy link

I'm trying to run the below snippet

use std::time::Duration;
use yeelib_rs::{
    fields::{PowerStatus, Transition},
    YeeClient,
};

fn main() {
    let client = YeeClient::new().expect("init fail");
    let mut all_lights = client.find_lights(Duration::from_secs(10));

    println!("{:?}", all_lights);

    let light = all_lights.get_mut(0).expect("no light");

    match light.power() {
        PowerStatus::Off => light
            .set_power(PowerStatus::On, Transition::sudden())
            .and_then(|_| light.set_bright(50, Transition::sudden()))
            .and_then(|_| light.set_ct_abx(3500, Transition::sudden()))
            .expect("light on fail"),
        PowerStatus::On => light
            .set_power(PowerStatus::Off, Transition::sudden())
            .expect("light off fail"),
    };
}

here all_lights always comes back as empty. It used to work previously, and I have another android app that works over the local network and can find the devices

@teppah
Copy link
Owner

teppah commented Jul 18, 2022

Hey @ryanhossain9797, I wrote this as a side-project to learn Rust a while ago but never completed it. I don't have access to Yeelight devices currently so unfortunately I can't troubleshoot the issue here. Please free to fork the library and complete it if you want!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants