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

Make all functions async, utilise new Python wrapper, better exception handling, improved device mapping #160

Merged
merged 8 commits into from Jul 24, 2020

Conversation

iMicknl
Copy link
Owner

@iMicknl iMicknl commented Jul 20, 2020

Depending on #159.

@iMicknl iMicknl added the enhancement New feature or request label Jul 20, 2020
@iMicknl iMicknl force-pushed the enhancement/add_new_python_api branch from 3a5911a to 4f579b8 Compare July 20, 2020 22:31
@iMicknl iMicknl added this to the core release milestone Jul 20, 2020
custom_components/tahoma/manifest.json Show resolved Hide resolved
custom_components/tahoma/__init__.py Outdated Show resolved Hide resolved
custom_components/tahoma/tahoma_device.py Show resolved Hide resolved
custom_components/tahoma/tahoma_device.py Show resolved Hide resolved
return
self.controller.get_states([self.tahoma_device])
self.schedule_update_ha_state()
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks not necessary? Do we know why this has been added here in the first place?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which part? last line?
schedule_update_ha_state() writes down the states to HA. maybe not necessary in an update method indeed.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not 100% sure, we should test this thoroughly.

@iMicknl
Copy link
Owner Author

iMicknl commented Jul 20, 2020

@tetienne @vlebourl this is ready for a (draft) review. Please note that you should skip the climate files for now, due to #159 not merged yet.

I think we should run this ourselves for a few days, to discover blocking bugs. Otherwise, we can merge this to master (or develop).

custom_components/tahoma/__init__.py Outdated Show resolved Hide resolved
custom_components/tahoma/__init__.py Outdated Show resolved Hide resolved
@tetienne
Copy link
Collaborator

Awesome work! Did you notice any improvement in perf?

@iMicknl
Copy link
Owner Author

iMicknl commented Jul 21, 2020

Awesome work! Did you notice any improvement in perf?

Not really, since I don't have any devices nearby to test. Would be good if you and @vlebourl give it a try with all your devices for a while :).

@iMicknl iMicknl marked this pull request as ready for review July 23, 2020 20:23
commit 1de0940
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Thu Jul 23 22:21:56 2020 +0200

    Squashed commit of the following:

    commit 6caeb9a
    Author: Vincent Le Bourlot <vlebourl@gmail.com>
    Date:   Thu Jul 23 13:21:40 2020 +0200

        Round float state to 2 digits. (#164)

        * Round float state to 2 digits.

        Github Issue: #163

    commit e6b4c22
    Author: Vincent Le Bourlot <vlebourl@gmail.com>
    Date:   Thu Jul 23 11:50:11 2020 +0200

        Cover position was incorrectly inverted when 0 because bool(0) == False. (#165)

    commit 05cd609
    Author: Vincent Le Bourlot <vlebourl@gmail.com>
    Date:   Thu Jul 23 08:27:39 2020 +0200

        Enhancement/refactor climate (#159)

        * First commit for AtlanticElectricalHeater.
        Github Issue: #151

        * Refactored climate.
        * **Breaking** Removed options flow
        * **Breaking** Removed SUPPORT_TARGET_TEMPERATURE for AtlanticElectricalHeater IO component
        * Removed private properties.
        * Removed update methods.
        * Removed __init__ when possible.
        * Moved classes to their own files.
        * Add DimmerExteriorHeating

        Github Issue: #151

        * Fix/fix 161 (#162)

        Github Issue: #161

commit 4f1b0a7
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Tue Jul 21 14:46:13 2020 +0200

    Change debug text

commit f212bc6
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Tue Jul 21 14:22:44 2020 +0200

    Reference to the right DOMAINS

commit 67e09af
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Tue Jul 21 14:17:11 2020 +0200

    Reference to official domains

commit a1cf008
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Tue Jul 21 14:04:37 2020 +0200

    Add missing LOCK import

commit c971da9
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Tue Jul 21 14:00:06 2020 +0200

    Add constants instead of ugly strings

commit 22a1623
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Tue Jul 21 13:49:08 2020 +0200

    Change PLATFORMS to SUPPORTED_PLATFORMS

commit a57d246
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Tue Jul 21 13:08:12 2020 +0200

    Revert removal of DOMAIN

commit bf410ec
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Tue Jul 21 13:05:30 2020 +0200

    Remove unused imports

commit 4884a5f
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Tue Jul 21 13:02:27 2020 +0200

    Reformat switch.py

commit 01c1df1
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Tue Jul 21 12:59:19 2020 +0200

    Bugfix for switch

commit a13348f
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Tue Jul 21 12:48:39 2020 +0200

    Close client before removing client...

commit 15bb8cd
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Tue Jul 21 12:45:53 2020 +0200

    Make code more readable

commit d896200
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Tue Jul 21 12:43:59 2020 +0200

    Close HTTP client correctly

    Thanks @eavanvalkenburg!

commit 24b7190
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Tue Jul 21 10:18:31 2020 +0200

    Remove unnecessary loop

commit 28cd639
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Tue Jul 21 09:45:46 2020 +0200

    Refactor based on feedback

commit d3ccafe
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Tue Jul 21 01:07:08 2020 +0200

    Simply config flow and add better exception logging

commit c38f2e5
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Tue Jul 21 01:01:39 2020 +0200

    Only initialize platforms with devices and decide platform based on uiclass and widget

commit 4f579b8
Author: Mick Vleeshouwer <mick@imick.nl>
Date:   Tue Jul 21 00:31:28 2020 +0200

    Add async Python API wrapper
@iMicknl iMicknl force-pushed the enhancement/add_new_python_api branch from 1de0940 to 8e4b8b2 Compare July 23, 2020 20:27
@iMicknl iMicknl requested a review from tetienne July 23, 2020 21:58
custom_components/tahoma/__init__.py Show resolved Hide resolved
custom_components/tahoma/config_flow.py Show resolved Hide resolved
@iMicknl iMicknl changed the title [enhancement] Add async Python api wrapper Make all functions async, utilise new Python wrapper, better exception handling, improved device mapping Jul 24, 2020
@@ -1,7 +1,7 @@
"""Support for TaHoma sensors."""
from datetime import timedelta
import logging
from typing import Optional
from typing import List, Optional
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you import list @vlebourl? Looks not used. :)

@iMicknl iMicknl merged commit 380ce84 into master Jul 24, 2020
@iMicknl iMicknl deleted the enhancement/add_new_python_api branch July 24, 2020 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants