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

Abstract out TWC interface code #483

Draft
wants to merge 62 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
e403c8a
First attempt; rearrange only
MikeBishop Nov 6, 2022
0567839
TWCSlave -> Gen2TWC
MikeBishop Nov 6, 2022
aeaa159
Move serial functions from TWCMaster into EVSEController
MikeBishop Nov 7, 2022
caaab49
Generalize VIN Entitlement checks
MikeBishop Nov 8, 2022
9d629b7
Dangling getSlaveTWCs() reference
MikeBishop Nov 8, 2022
0e89cc9
Remove more slave instances
MikeBishop Nov 8, 2022
ed59da9
Lift charging decisions to TWCManager
MikeBishop Nov 9, 2022
83dc1de
Add a few comments
MikeBishop Nov 9, 2022
05756c9
Additional data from Tesla API
MikeBishop Nov 9, 2022
01292ef
Tesla API controller
MikeBishop Nov 9, 2022
c9324cd
Tesla API and Merged EVSE implementation
MikeBishop Nov 10, 2022
ede1061
Move get[Slave]Lifetime into controller
MikeBishop Nov 10, 2022
74eb3d4
Restrict HTTP Control to TWCs, not other EVSEs
MikeBishop Nov 12, 2022
af0a882
fixup! Restrict HTTP Control to TWCs, not other EVSEs
MikeBishop Nov 13, 2022
cc38193
Dangling misref
MikeBishop Nov 13, 2022
a884930
Only consider TWCs when limiting to wiringMaxAmpsAllTWCs
MikeBishop Nov 14, 2022
0630f30
Lift startStopDelay into Distribute Power
MikeBishop Nov 14, 2022
60a0abe
Fixup web UI to only see TWCs for now
MikeBishop Nov 15, 2022
c0ea6c9
lastPowerChange consistency
MikeBishop Nov 16, 2022
052ff03
Zero target power means stop charging
MikeBishop Nov 16, 2022
54ce9bf
Make actualCurrent a property
MikeBishop Nov 16, 2022
dddbe6d
Blacken
MikeBishop Nov 16, 2022
0ff080f
Move Dedupe into Master; leverage in more places
MikeBishop Nov 17, 2022
f876c48
snapHistoryData in MergedEVSE
MikeBishop Nov 17, 2022
912aa13
snapHistoryData for Merged EVSE
MikeBishop Nov 17, 2022
5f8d05a
Don't use maxPower on Tesla API so easily
MikeBishop Nov 18, 2022
87d1c8c
MQTT prefix fix
MikeBishop Dec 22, 2022
669d35a
MQTT prefix fix
MikeBishop Dec 22, 2022
f5c0310
Account for multi-level prefixes
MikeBishop Dec 23, 2022
1017cfc
Merge branch 'mqtt_prefix' into charging_abstract
MikeBishop Dec 23, 2022
2364d46
Allow longer lead time for reactive spikeAmps
MikeBishop Dec 23, 2022
761bfb6
Fix setattr invocation
MikeBishop Dec 23, 2022
ee55555
Cache data about unknown vehicles and apply after
MikeBishop Dec 23, 2022
c1073fc
self.self
MikeBishop Jan 8, 2023
9f19eff
MQTT Reset every 24 hours
MikeBishop Feb 15, 2023
d1ffe88
Lazy charge status
MikeBishop Feb 15, 2023
4111298
DO NOT MERGE: Log API calls
MikeBishop Feb 17, 2023
6df42b7
Try deferring charge status as well
MikeBishop Feb 23, 2023
5a224ba
Head off parallel queries
MikeBishop Feb 23, 2023
1211ea0
No charge_state in MQTT
MikeBishop Feb 23, 2023
339f54e
Make TeslaMate watchdog thread a daemon
MikeBishop Feb 27, 2023
4b338ca
Move lastAPIAccessTime updates after API call
MikeBishop Feb 27, 2023
7f95dde
Remove bogus MQTT events
MikeBishop Feb 28, 2023
302aa05
Exception handling, pass->continue
MikeBishop Mar 1, 2023
b2bcf71
Only subscribe to relevant events
MikeBishop Mar 1, 2023
7cddbf3
fixup! Only subscribe to relevant events
MikeBishop Mar 1, 2023
719d2c2
fixup! fixup! Only subscribe to relevant events
MikeBishop Mar 1, 2023
86f2ffa
!fixup No charge_state in MQTT
MikeBishop Mar 4, 2023
60a73e7
Add "requested" charge result
MikeBishop Mar 4, 2023
7b199a5
Avoid pattern of catching KeyError exception
MikeBishop Mar 5, 2023
8af8bc3
fixup! Avoid pattern of catching KeyError exception
MikeBishop Mar 5, 2023
c7d069d
Condense non-error start/stop charge code
MikeBishop Mar 7, 2023
1ab548d
Catch exceptions evaluating policy
MikeBishop Mar 20, 2023
28f87b8
Defer longer during charge_state queries
MikeBishop May 1, 2023
74d1633
Change to vehicle_data
MikeBishop May 1, 2023
6c8383e
Change update_charge gate properties
MikeBishop May 4, 2023
cf392bf
Add error check
MikeBishop May 6, 2023
902dfef
Don't retry if we've entered error backoff
MikeBishop May 11, 2023
6645962
Network exception resilience
MikeBishop May 23, 2023
68b587b
shift_state is in drive_state
MikeBishop May 25, 2023
2d59f3a
Fix vehicle_data for api_version 67
RichieB2B Nov 11, 2023
dac28d4
Change to products endpoint
MikeBishop Feb 25, 2024
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
Prev Previous commit
Next Next commit
Defer longer during charge_state queries
MikeBishop committed May 1, 2023
commit 28f87b80290e69fa80496a0e0432eec37b853d25
2 changes: 1 addition & 1 deletion lib/TWCManager/Vehicle/TeslaAPI.py
Original file line number Diff line number Diff line change
@@ -1469,7 +1469,7 @@ def update_charge(self, lazy = False):
if now < self.chargeStatusDeferral:
return True
else:
self.chargeStatusDeferral = now + 5
self.chargeStatusDeferral = now + 60

url = "https://owner-api.teslamotors.com/api/1/vehicles/"
url = url + str(self.ID) + "/data_request/charge_state"