Add F2600 support#35
Conversation
flip-dots
left a comment
There was a problem hiding this comment.
So this is pretty good, just a few minor things.
The whole get_status_update thing is not very well thought out and that is my fault, I added it as a "this is kind of neat but I don't have a use for it" type of thing and did not look into it any further and left it kind of half arsed. It's something I will probably address eventually but these kinds of architectural changes will need to wait until I have more time when my dissertation and exams are over which will be in a couple of months.
Since this is a fairly simple PR which does not require much time on my part if you just fix the mentioned issues from the comments I am happy to merge it and deal with the bigger architectural changes later, though I might not have the time to add it to the Home Assistant integration for a while.
| """ | ||
| F2600 Power Station. | ||
|
|
||
| Use this class to connect and monitor a F2600 power station. |
|
|
||
| :returns: Status of the USB C2 port. | ||
| """ | ||
| return PortStatus(self._parse_int("c7", begin=1)) |
There was a problem hiding this comment.
Needs to use the same naming scheme as other devices (e.g c300)
| :raises ConnectionError: If not connected to device. | ||
| :raises BleakError: If command transmission fails. | ||
| """ | ||
| if watts < 100 or watts > 1440: # below 100 causes max charge, 1440 is max in app. |
There was a problem hiding this comment.
Does it let you set arbitrary values?, in my experience these things are limited to specific values like 100, 200, 300, etc.
| ) | ||
| from ..states import DisplayTimeout, LightStatus, PortStatus | ||
|
|
||
| from . import F2000 |
There was a problem hiding this comment.
Since this is a new device a page needs to be added to the docs for it as well as updating the index page with the supported capabilities, #14 should be a good example of how to do it.
Add F2600 support as discussed in #34
Tested on my own F2600 to the best of my ability.
It seems that some parameters like AC charge power and display timeout seconds are only returned during a full "get_status_update" response. Currently the
_process_telemetryfunction will overwrite_dataon every call, so if there is a response from the battery that does not include everything, all other parameters will be removed. While I was doing my testing I made a change to update parameters instead of a full overwrite, if you think that is useful it can be found here: https://github.com/unex/SolixBLE/tree/update-parameters