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

USB energy refactor #124

Closed
wants to merge 87 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
e240edc
Rename NodeResponse into USBresponse
brefra Jan 3, 2022
2c7701d
Rename NodeAckSmallResponse into StickResponse
brefra Jan 3, 2022
4e23bd2
Rename NodeAckLargeResponse into NodeResponse
brefra Jan 3, 2022
91d2796
Make message priority an Enum
brefra Jan 3, 2022
837e725
Use UTC time in controller
brefra Jan 3, 2022
ed4034c
Rename NodeRequest into PlugwiseRequest
brefra Jan 3, 2022
0d4b05d
Rename USBresponse into PlugwiseResponse
brefra Jan 3, 2022
dda6e4a
Rename NodeJoinAckResponse into NodeRejoinResponse
brefra Jan 4, 2022
16b37e7
Make timestamp messages timezone aware
brefra Jan 4, 2022
315c7e3
Add Enums of message response types
brefra Jan 4, 2022
ee50933
Add message priority enum
brefra Jan 4, 2022
0823fb2
Apply consistency to message process methods
brefra Jan 4, 2022
a7217cd
Make use of super() for message handling at node classes
brefra Jan 4, 2022
4011384
Apply consistency to message process methods
brefra Jan 4, 2022
10b2a60
Make callbacks local to node classes
brefra Jan 4, 2022
b48b412
Cleanup and correction of imports
brefra Jan 4, 2022
963a838
Add NodeRejoinResponse to sed
brefra Jan 4, 2022
74a9aa0
Move all actions to _process methods
brefra Jan 4, 2022
cfc889c
Refactor message_processor method of Stick class
brefra Jan 4, 2022
667f502
Add local callbacks to stick class
brefra Jan 4, 2022
e6f279f
Add logging for non processed message reponses
brefra Jan 4, 2022
c2360d7
Move non validated response types to response.py
brefra Jan 4, 2022
33faa6d
Add missing future imports
brefra Jan 4, 2022
459a911
Correct callback leftovers
brefra Jan 4, 2022
e546862
Make datetime timezone aware
brefra Jan 4, 2022
62469de
Remove duplicate decode
brefra Jan 4, 2022
8f5afcd
Apply some code formatting
brefra Jan 4, 2022
cca7a88
Add addtional properties to PlugwiseRequest class
brefra Jan 4, 2022
6322564
Rewrite StickMessageController
brefra Jan 4, 2022
539c95e
Move retry & priority to PlugwiseRequest class
brefra Jan 4, 2022
6e3fec4
Increase power update frequency
brefra Jan 4, 2022
6b377dc
Cleanup controller
brefra Jan 4, 2022
071c0ea
Correct description of controller
brefra Jan 4, 2022
2c5868e
Drop duplicate requests at controller
brefra Jan 4, 2022
ece93bc
Use pending requests in busy state of controller
brefra Jan 4, 2022
9fa4c16
Limit message retries at discovery phase
brefra Jan 4, 2022
1b1c67b
Do not forward JoinAccepted to nodes
brefra Jan 4, 2022
a3fd8fa
Lower logger level for expected messages
brefra Jan 4, 2022
2a38c98
Delete finished request from timeout thread
brefra Jan 5, 2022
4be2f3e
Introduce SPECIAL_SEQ_IDS
brefra Jan 5, 2022
1ac22cc
Do not mark request duplicate if previous finished
brefra Jan 5, 2022
15e698f
Add 'drop_at_timeout' property to request messages
brefra Jan 7, 2022
f042494
Make IGNORE_DUPLICATES const
brefra Jan 7, 2022
5b8b8bc
Add typing to _init_ of node classes
brefra Jan 4, 2022
b40b29e
Rename const MESSAGE_SMALL & MESSAGE_LARGE
brefra Jan 4, 2022
8746d29
Change NODE_TYPE_* into a NodeType Enum
brefra Jan 4, 2022
4b1971f
Define USB device property features
brefra Jan 4, 2022
ada2715
Add DAY_IN_SECONDS constant
brefra Jan 4, 2022
e5661f0
Reorder NodePintResponse
brefra Jan 4, 2022
b901025
Use DAY_IN_MINUTES & HOUR_IN_MINUTES constants
brefra Jan 4, 2022
8d11924
Reorder properties PlugwiseNode class
brefra Jan 4, 2022
6fb3549
Add more typing to PlugwiseNode class
brefra Jan 4, 2022
ee2217a
Add typing to Stick class
brefra Jan 4, 2022
35efa77
Make Plugwise DateTime class timezone aware
brefra Jan 4, 2022
ab00cba
Standardize callback scan_finished
brefra Jan 5, 2022
745e326
Make node available when message is received
brefra Jan 5, 2022
60925b9
Don't log warning for timeout to ping requests
brefra Jan 5, 2022
ecfad4e
Simplify logic for _nodes_not_discovered
brefra Jan 5, 2022
c9d8e0c
Correct _callback_NodeInfo
brefra Jan 5, 2022
bff7e32
Only discover unknown nodes after JoinAccept
brefra Jan 5, 2022
12fa81f
Mark power nodes unavailable after 5 minutes
brefra Jan 5, 2022
4a38cfd
Rename _request_info into _request_NodeInfo
brefra Jan 6, 2022
4ca3671
Rename _request_ping into _request_NodePing
brefra Jan 6, 2022
dd11e53
Add more typing
brefra Jan 6, 2022
36ee7d6
Make features extendable
brefra Jan 9, 2022
582e3f2
Update typing & comments to request and response
brefra Jan 9, 2022
73a2728
Full rewrite of energy
brefra Jan 9, 2022
52150ae
Add missing MESSAGE_RETRY import
brefra Jan 9, 2022
25a2d22
Reorder and cleanup do... methods
brefra Jan 9, 2022
59e858d
Guard for none discovered node
brefra Jan 9, 2022
31767e0
Correct comments
brefra Jan 9, 2022
31133b3
Cleanup logging
brefra Jan 9, 2022
dbd40d7
Fix mac validation at response messages
brefra Jan 9, 2022
2a45257
Remove duplicate logging
brefra Jan 9, 2022
c28eb7f
Apply formatting to CHANGELOG.md
brefra Jan 9, 2022
d5eb125
Update CHANGELOG.md
brefra Jan 9, 2022
64d4a62
fixup: USB_energy_refactor Python code reformatted using Black
Jan 9, 2022
2eff0ff
Change logging to debug for expected timeouts
brefra Jan 9, 2022
6eee26f
Revert accidentally unrelated committed code
brefra Jan 9, 2022
e6144e2
Apply codespell
brefra Jan 9, 2022
1e4b987
Fix processing and logging of "drop_at_timeout" requests
brefra Jan 12, 2022
b88d6f8
Fix collecting missing production logs
brefra Jan 12, 2022
10b6ec3
Remove unused node state
brefra Jan 16, 2022
aea22df
fixup: USB_energy_refactor Python code reformatted using Black
Jan 20, 2022
49693cb
Bump to 0.16.2.a0
brefra Jan 20, 2022
539d1bc
Bump to 0.15.8
brefra Jan 21, 2022
d9cc0ea
Correct changelog
brefra Jan 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 34 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,47 @@
# Changelog

# v0.16.0 - Smile - Change output format, allowing full use of Core DataUpdateCoordintor in plugwise-beta
- Change from list- to dict-format for binary_sensors, sensors and switches
- Provide gateway-devices for Legacy Anna and Stretch
- Code-optimizations

- Change from list- to dict-format for binary_sensors, sensors and switches
- Provide gateway-devices for Legacy Anna and Stretch
- Code-optimizations

# v0.15.8 - Stick - Improve performance and energy monitoring

- Improved timeout message handling based on response messages of USB-stick
- More frequent energy monitoring polling when Stick is idle
- Full rewrite of energy collection code. No dependency to fixed log interval. Should fix
- [#149]https://github.com/plugwise/plugwise-beta/issues/149
- [157]https://github.com/plugwise/plugwise-beta/issues/157
- Added ability to change energy log interval
- Added full support for energy production [#39](https://github.com/plugwise/python-plugwise/issues/39)

# v0.15.7 - Smile - Improve implementation of cooling-function-detection
- Anna: add two sensors related to automatic switching between heating and cooling and add a heating/cooling-mode active indication
- Adam: also provide a heating/cooling-mode active indication
- Fixing #171
- Improved dependency handling (@dependabot)

- Anna: add two sensors related to automatic switching between heating and cooling and add a heating/cooling-mode active indication
- Adam: also provide a heating/cooling-mode active indication
- Fixing #171
- Improved dependency handling (@dependabot)

# v0.15.6 - Smile - Various fixes and improvements
- Adam: collect `control_state` from master thermostats, allows showing the thermostat state as on the Plugwise App
- Adam: collect `allowed_modes` and look for `cooling`, indicating cooling capability being available
- Optimize code: use `_all_appliances()` once instead of 3 times, by updating/changing `single_master_thermostat()`,
- Protect several more variables,
- Change/improve how `illuminance` and `outdoor_temperature` are obtained,
- Use walrus operator where applicable,
- Various small code improvements,
- Add and adapt testcode
- Add testing for python 3.10, improve dependencies (github workflow)
- Bump aiohttp to 3.8.1, remove fixed dependencies

- Adam: collect `control_state` from master thermostats, allows showing the thermostat state as on the Plugwise App
- Adam: collect `allowed_modes` and look for `cooling`, indicating cooling capability being available
- Optimize code: use `_all_appliances()` once instead of 3 times, by updating/changing `single_master_thermostat()`,
- Protect several more variables,
- Change/improve how `illuminance` and `outdoor_temperature` are obtained,
- Use walrus operator where applicable,
- Various small code improvements,
- Add and adapt testcode
- Add testing for python 3.10, improve dependencies (github workflow)
- Bump aiohttp to 3.8.1, remove fixed dependencies

# v0.15.5 - Skipping, not released

## v0.15.4 - Smile - Bugfix: handle removed thermostats
- Recognize when a thermostat has been removed from a zone and don't show it in Core
- Rename Group Switch to Switchgroup, remove vendor name

- Recognize when a thermostat has been removed from a zone and don't show it in Core
- Rename Group Switch to Switchgroup, remove vendor name

## v0.15.3 - Skipping, not released

Expand All @@ -48,7 +62,7 @@

## v0.14.1 - Smile: removing further `last_reset`s

- As per https://developers.home-assistant.io/blog/2021/08/16/state_class_total
- As per <https://developers.home-assistant.io/blog/2021/08/16/state_class_total>

## v0.14.0 - Smile: sensor-platform updates - 2021.9 compatible

Expand Down
2 changes: 1 addition & 1 deletion plugwise/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Plugwise module."""

__version__ = "0.16.0"
__version__ = "0.15.8"

from plugwise.smile import Smile
from plugwise.stick import Stick
4 changes: 2 additions & 2 deletions plugwise/connections/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import time

from ..constants import SLEEP_TIME
from ..messages.requests import NodeRequest
from ..messages.requests import PlugwiseRequest

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -96,7 +96,7 @@ def _writer_daemon(self):
def _write_data(self, data):
"""Placeholder."""

def send(self, message: NodeRequest, callback=None):
def send(self, message: PlugwiseRequest, callback=None):
"""Add message to write queue."""
self._write_queue.put_nowait((message, callback))

Expand Down
Loading