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

Connecting to a Pure Hot+Cool Hangs #12

Open
blakemotl opened this issue Oct 26, 2017 · 3 comments
Open

Connecting to a Pure Hot+Cool Hangs #12

blakemotl opened this issue Oct 26, 2017 · 3 comments

Comments

@blakemotl
Copy link

blakemotl commented Oct 26, 2017

import json
from libpurecoollink.dyson import DysonAccount
from libpurecoollink.const import FanSpeed, FanMode, NightMode, Oscillation,
FanState, StandbyMonitoring, QualityTarget, ResetFilter, HeatMode,
FocusMode, HeatTarget

if __name__ == '__main__':
with open('config.json') as json_data:
config = json.load(json_data)
dyson_acc = DysonAccount(config["dyson_user"], config["dyson_pass"], config["dyson_lang"])
login_status = dyson_acc.login()
if not login_status:
print("Failed to login to Dyson account.")
devices = dyson_acc.devices()
device = devices[0].connect("192.168.1.157")

Using the above code, results in a hang on the connect line. Doesn't matter if I use auto_connect or connect directly to the host. If I manually connect to the device using paho-mqtt(and I captured the user/pass using wireshark) I am able to connect no problem. I have tried it from multiple environments/hosts all who can talk directly to the device.

@CharlesBlonde
Copy link
Owner

Hi,

I have been quite busy this last month but I'll take a look quickly !

@tmonjalo
Copy link

Hi,

I have a connection issue too (no discovery, no manual connection).
I have checked that the device is recognized as DysonPureCoolLink instance, especially as DYSON_PURE_COOL_LINK_TOUR.
When looking in Wireshark, it seems my Pure Cool Link is not replying to the MQTT connect.

How can I help?

@theboyknowsclass
Copy link

theboyknowsclass commented Nov 27, 2018

I'm also having a similar (or related issue), in that it hangs on second run?

I also notice in VS code that some threads are still lingering

def setfanspeed(ip, speed):
    dyson_account = DysonAccount(...)
    logged = dyson_account.login()

    if not logged:
        print('Unable to login to Dyson account')
        exit(1)

    devices = dyson_account.devices()
    name = devices[0].name

    if not devices[0].connected:
        connected = devices[0].connect(ip)

    if devices[0].connected:
        devices[0].set_configuration(fan_speed=FanSpeed(speed))
        devices[0].disconnect()
        content = "Dyson Fan at IP " + ip + "(" + name + ") is set to speed " + speed
    else:
        content = "ERROR: Setting Dyson Fan at IP " + ip + "(" + name + ") to speed " + speed

    return content```

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

4 participants