Coder Social home page Coder Social logo

Comments (3)

watchforstock avatar watchforstock commented on July 17, 2024

Thanks for this. The short answer is I'm not sure! I've not worked with the asyncio stuff before, or used packages that have. I think I probably agree with your preferred option of a different repo unless there's a well established pattern that others have used for other python packages.

If we do go with the separate repo, it presumably makes sense to host it under your github account. I'm obviously more than happy to make sure there are links from github and docs to the other repo to make sure people can find it.

from evohome-client.

zxdavb avatar zxdavb commented on July 17, 2024

OK, I'll implement as a separate github repo, and a separate pypi package. The plan will be to make minimal changes, and certainly keep as close as possible to the existing docs:

Old way:

    try:  # this invokes client._login
        client = self.client = evohomeclient3.EvohomeClient(
            self.params[CONF_USERNAME],
            self.params[CONF_PASSWORD],
            refresh_token=refresh_token,
            access_token=access_token,
            access_token_expires=access_token_expires
        )
    except (
        requests.exceptions.RequestException,
        evohomeclient2.AuthenticationError,
    ) as err:
        if not _handle_exception(err):
            return False
    finally:
        self.config = client.installation_info[loc_idx][GWS][0][TCS][0]

New way (add client.login() because you can't do asyncio in __init__()):

    client = self.client = evohomeclient3.EvohomeClient(
        self.params[CONF_USERNAME],
        self.params[CONF_PASSWORD],
        refresh_token=refresh_token,
        access_token=access_token,
        access_token_expires=access_token_expires,
        debug=True
    )
    try:
        await client.login()
    except (
        aiohttp.ClientResponseError,
        evohomeclient2.AuthenticationError,
    ) as err:
        if not _handle_exception(err):
            return False
    finally:
        self.config = client.installation_info[loc_idx][GWS][0][TCS][0]

from evohome-client.

zxdavb avatar zxdavb commented on July 17, 2024

OK, evohome-async is up, and is based upon your 0.3.3.

evohomeclient2 is (fully?) ported, but evohomeclient1 is not yet ported.

I'd be pleased to give you write access to the github repo and/or pypi package if you wish.

from evohome-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.