Skip to content

Commit

Permalink
Merge pull request #106 from jasonacox/v0.10.8
Browse files Browse the repository at this point in the history
TEDAPI functions for firmware version and PW3
  • Loading branch information
jasonacox authored Jul 7, 2024
2 parents f2d54f2 + 6c50bdf commit fcb24f0
Show file tree
Hide file tree
Showing 7 changed files with 425 additions and 25 deletions.
5 changes: 5 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# RELEASE NOTES

## v0.10.8 - TEDAPI Firmware Version

* Add TEDAPI `get_firmware_version()` to poll Powerwall for firmware version. Discovered by @geptto in https://github.com/jasonacox/pypowerwall/issues/97. This function has been integrated into pypowerwall existing APIs (e.g. `pw.version()`)
* Add TEDAPI `get_components()` and `get_battery_block()` functions which providing additional Powerwall 3 related device vital information for Powerwall 3 owners. Discovered by @lignumaqua in https://github.com/jasonacox/Powerwall-Dashboard/discussions/392#discussioncomment-9864364. The plan it to integrate this data into the other device vitals payloads (TODO).

## v0.10.7 - Energy History

* FleetAPI - Add `get_history()` and `get_calendar_history()` to return energy, power, soe, and other history data.
Expand Down
2 changes: 1 addition & 1 deletion proxy/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pypowerwall==0.10.6
pypowerwall==0.10.8
bs4==0.0.2
2 changes: 1 addition & 1 deletion pypowerwall/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
from typing import Union, Optional
import time

version_tuple = (0, 10, 7)
version_tuple = (0, 10, 8)
version = __version__ = '%d.%d.%d' % version_tuple
__author__ = 'jasonacox'

Expand Down
254 changes: 254 additions & 0 deletions pypowerwall/tedapi/__init__.py

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pypowerwall/tedapi/pypowerwall_tedapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def get_api_system_status_soe(self, **kwargs) -> Optional[Union[dict, list, str,
def get_api_status(self, **kwargs) -> Optional[Union[dict, list, str, bytes]]:
force = kwargs.get('force', False)
config = self.tedapi.get_config(force=force)
firmware_version = self.tedapi.get_firmware_version(force=force)
if config is None:
data = None
else:
Expand All @@ -193,7 +194,7 @@ def get_api_status(self, **kwargs) -> Optional[Union[dict, list, str, bytes]]:
"start_time": lookup(config,["site_info", "battery_commission_date"]),
"up_time_seconds": None,
"is_new": False,
"version": __version__, # TODO
"version": firmware_version,
"git_hash": None,
"commission_count": 0,
"device_type": None,
Expand Down
126 changes: 126 additions & 0 deletions pypowerwall/tedapi/tedapi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ message MessageEnvelope {
int32 deliveryChannel = 1;
Participant sender = 2;
Participant recipient = 3;
FirmwareType firmware = 4;
optional ConfigType config = 15;
optional QueryType payload = 16;
}
Expand All @@ -39,6 +40,51 @@ message Tail {
int32 value = 1;
}

// ***** Query = 4 ****

message FirmwareType {
oneof id {
string request = 2;
FirmwarePayload system = 3;
}
}

message FirmwarePayload {
EcuId gateway = 1;
string din = 2;
FirmwareVersion version = 3;
FirmwareFive five = 5;
int32 six = 6;
DeviceArray wireless = 7;
bytes field8 = 8;
bytes field9 = 9;
}

message EcuId {
string partNumber = 1;
string serialNumber = 2;
}

message FirmwareVersion {
string text = 1;
bytes githash = 2;
}

message FirmwareFive {
int32 d = 2;
}

message DeviceArray {
repeated DeviceInfo device = 1;
}

message DeviceInfo {
StringValue company = 1;
StringValue model = 2;
StringValue fcc_id = 3;
StringValue ic = 4;
}

// ***** Query = 16 *****

message QueryType { // 16
Expand Down Expand Up @@ -179,4 +225,84 @@ message StringValue {
// }
// 2 {
// 1: 1
// }
//
// REQUEST - firmware
// 1 {
// 1: 1
// 2 {
// 3: 1
// }
// 3 {
// 1: "1707000-00-J--TG9999999999XP"
// }
// 4 {
// 2: ""
// }
// }
// 2 {
// 1: 1
// }
//
// RESPONSE - firmware
// 1 {
// 1: 1
// 2 {
// 1: "1707000-00-J--TG9999999999XP"
// }
// 3 {
// 3: 1
// }
// 4 {
// 3 {
// 1 {
// 1: "1707000-00-J"
// 2: "TG9999999999XP"
// }
// 2: "1707000-00-J--TG9999999999XP"
// 3 {
// 1: "24.12.6-PW3-AFCI 008bf6ff" <--- PW3 firmware version
// 2: "\000\213\366\...Redacted..."
// }
// 5 {
// 2: 1
// }
// 6: 4
// 7 {
// 1 {
// 1 {
// 1: "Quectel"
// }
// 2 {
// 1: "BG95-M2"
// }
// 3 {
// 1: "XMR2020BG95M2"
// }
// 4 {
// 1: "10224A-2020BG95M2"
// }
// }
// 1 {
// 1 {
// 1: "Texas Instruments"
// }
// 2 {
// 1: "WL18MODGI"
// }
// 3 {
// 1: "Z64-WL18DBMOD"
// }
// 4 {
// 1: "451I-WL18DBMOD"
// }
// }
// }
// 8: "\370!s\306\212...Redacted..."
// 9: "\373U\353\322...Redacted..."
// }
// }
// }
// 2 {
// 1: 1
// }
58 changes: 36 additions & 22 deletions pypowerwall/tedapi/tedapi_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fcb24f0

Please sign in to comment.