foxesscloud 2.5.6__py3-none-any.whl → 2.5.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- foxesscloud/foxesscloud.py +9 -7
- foxesscloud/openapi.py +9 -7
- {foxesscloud-2.5.6.dist-info → foxesscloud-2.5.7.dist-info}/METADATA +5 -1
- foxesscloud-2.5.7.dist-info/RECORD +7 -0
- foxesscloud-2.5.6.dist-info/RECORD +0 -7
- {foxesscloud-2.5.6.dist-info → foxesscloud-2.5.7.dist-info}/LICENCE +0 -0
- {foxesscloud-2.5.6.dist-info → foxesscloud-2.5.7.dist-info}/WHEEL +0 -0
- {foxesscloud-2.5.6.dist-info → foxesscloud-2.5.7.dist-info}/top_level.txt +0 -0
foxesscloud/foxesscloud.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################################
|
2
2
|
"""
|
3
3
|
Module: Fox ESS Cloud
|
4
|
-
Updated:
|
4
|
+
Updated: 28 September 2024
|
5
5
|
By: Tony Matthews
|
6
6
|
"""
|
7
7
|
##################################################################################################
|
@@ -10,7 +10,7 @@ By: Tony Matthews
|
|
10
10
|
# ALL RIGHTS ARE RESERVED © Tony Matthews 2023
|
11
11
|
##################################################################################################
|
12
12
|
|
13
|
-
version = "1.6.
|
13
|
+
version = "1.6.9"
|
14
14
|
print(f"FoxESS-Cloud version {version}")
|
15
15
|
|
16
16
|
debug_setting = 1
|
@@ -742,7 +742,7 @@ def charge_periods(st1=None, en1=None, st2=None, en2=None, min_soc=10, end_soc=1
|
|
742
742
|
charge.append({'start': st1, 'end': st3, 'mode': 'SelfUse', 'min_soc': start_soc})
|
743
743
|
st1 = st3
|
744
744
|
charge.append({'start': st1, 'end': en1, 'mode': 'SelfUse', 'min_soc': min_soc})
|
745
|
-
strategy = get_strategy(remove=span)[:(8 - len(charge))]
|
745
|
+
strategy = get_strategy(remove=span, limit=24)[:(8 - len(charge))]
|
746
746
|
for c in charge:
|
747
747
|
strategy.append(c)
|
748
748
|
periods = []
|
@@ -2208,7 +2208,7 @@ test_strategy = [
|
|
2208
2208
|
{'start': 21, 'end': 22, 'mode': 'ForceCharge'}]
|
2209
2209
|
|
2210
2210
|
# return a strategy that has been sorted and filtered for charge times:
|
2211
|
-
def get_strategy(use=None, strategy=None, quiet=1, remove=None, reserve=0):
|
2211
|
+
def get_strategy(use=None, strategy=None, quiet=1, remove=None, reserve=0, limit=None):
|
2212
2212
|
global tariff, base_time
|
2213
2213
|
if use is None:
|
2214
2214
|
use = tariff
|
@@ -2221,8 +2221,9 @@ def get_strategy(use=None, strategy=None, quiet=1, remove=None, reserve=0):
|
|
2221
2221
|
if use.get('agile') is not None and use['agile'].get('strategy') is not None:
|
2222
2222
|
base_time_adjust = hours_difference(base_time, use['agile'].get('base_time') )
|
2223
2223
|
for s in use['agile']['strategy']:
|
2224
|
-
|
2225
|
-
|
2224
|
+
if limit is None or s.get('hour') is None or s['hour'] - base_time_adjust < 24:
|
2225
|
+
s['valid_for'] = [int((s['hour'] - base_time_adjust) * steps_per_hour + i) for i in range(0, steps_per_hour // 2)] if s.get('hour') is not None else None
|
2226
|
+
strategy.append(s)
|
2226
2227
|
if strategy is None or len(strategy) == 0:
|
2227
2228
|
return []
|
2228
2229
|
updated = []
|
@@ -2344,7 +2345,8 @@ def get_agile_times(tariff=agile_octopus, d=None):
|
|
2344
2345
|
output(f"\nPlunge slots:", 1)
|
2345
2346
|
for t in plunge:
|
2346
2347
|
strategy.append(prices[t])
|
2347
|
-
|
2348
|
+
date = (now + timedelta(hours = prices[t]['hour'])).strftime("%Y-%m-%d")
|
2349
|
+
output(f" {format_period(prices[t])} at {prices[t]['price']:.1f}p on {date}", 1)
|
2348
2350
|
tariff['agile']['strategy'] = strategy
|
2349
2351
|
for key in ['off_peak1', 'off_peak2', 'off_peak3', 'off_peak4']:
|
2350
2352
|
if tariff.get(key) is None:
|
foxesscloud/openapi.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################################
|
2
2
|
"""
|
3
3
|
Module: Fox ESS Cloud using Open API
|
4
|
-
Updated:
|
4
|
+
Updated: 28 September 2024
|
5
5
|
By: Tony Matthews
|
6
6
|
"""
|
7
7
|
##################################################################################################
|
@@ -10,7 +10,7 @@ By: Tony Matthews
|
|
10
10
|
# ALL RIGHTS ARE RESERVED © Tony Matthews 2024
|
11
11
|
##################################################################################################
|
12
12
|
|
13
|
-
version = "2.5.
|
13
|
+
version = "2.5.7"
|
14
14
|
print(f"FoxESS-Cloud Open API version {version}")
|
15
15
|
|
16
16
|
debug_setting = 1
|
@@ -690,7 +690,7 @@ def charge_periods(st1=None, en1=None, st2=None, en2=None, min_soc=10, end_soc=1
|
|
690
690
|
charge.append({'start': st1, 'end': st3, 'mode': 'SelfUse', 'min_soc': start_soc})
|
691
691
|
st1 = st3
|
692
692
|
charge.append({'start': st1, 'end': en1, 'mode': 'SelfUse', 'min_soc': min_soc})
|
693
|
-
strategy = get_strategy(remove=span)[:(8 - len(charge))]
|
693
|
+
strategy = get_strategy(remove=span, limit=24)[:(8 - len(charge))]
|
694
694
|
for c in charge:
|
695
695
|
strategy.append(c)
|
696
696
|
periods = []
|
@@ -2072,7 +2072,7 @@ test_strategy = [
|
|
2072
2072
|
{'start': 21, 'end': 22, 'mode': 'ForceCharge'}]
|
2073
2073
|
|
2074
2074
|
# return a strategy that has been sorted and filtered for charge times:
|
2075
|
-
def get_strategy(use=None, strategy=None, quiet=1, remove=None, reserve=0):
|
2075
|
+
def get_strategy(use=None, strategy=None, quiet=1, remove=None, reserve=0, limit=None):
|
2076
2076
|
global tariff, base_time
|
2077
2077
|
if use is None:
|
2078
2078
|
use = tariff
|
@@ -2085,8 +2085,9 @@ def get_strategy(use=None, strategy=None, quiet=1, remove=None, reserve=0):
|
|
2085
2085
|
if use.get('agile') is not None and use['agile'].get('strategy') is not None:
|
2086
2086
|
base_time_adjust = hours_difference(base_time, use['agile'].get('base_time') )
|
2087
2087
|
for s in use['agile']['strategy']:
|
2088
|
-
|
2089
|
-
|
2088
|
+
if limit is None or s.get('hour') is None or s['hour'] - base_time_adjust < 24:
|
2089
|
+
s['valid_for'] = [int((s['hour'] - base_time_adjust) * steps_per_hour + i) for i in range(0, steps_per_hour // 2)] if s.get('hour') is not None else None
|
2090
|
+
strategy.append(s)
|
2090
2091
|
if strategy is None or len(strategy) == 0:
|
2091
2092
|
return []
|
2092
2093
|
updated = []
|
@@ -2208,7 +2209,8 @@ def get_agile_times(tariff=agile_octopus, d=None):
|
|
2208
2209
|
output(f"\nPlunge slots:", 1)
|
2209
2210
|
for t in plunge:
|
2210
2211
|
strategy.append(prices[t])
|
2211
|
-
|
2212
|
+
date = (now + timedelta(hours = prices[t]['hour'])).strftime("%Y-%m-%d")
|
2213
|
+
output(f" {format_period(prices[t])} at {prices[t]['price']:.1f}p on {date}", 1)
|
2212
2214
|
tariff['agile']['strategy'] = strategy
|
2213
2215
|
for key in ['off_peak1', 'off_peak2', 'off_peak3', 'off_peak4']:
|
2214
2216
|
if tariff.get(key) is None:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: foxesscloud
|
3
|
-
Version: 2.5.
|
3
|
+
Version: 2.5.7
|
4
4
|
Summary: library for accessing Fox ESS cloud data using Open API
|
5
5
|
Author-email: Tony Matthews <tony@quasair.co.uk>
|
6
6
|
Project-URL: Homepage, https://github.com/TonyM1958/FoxESS-Cloud
|
@@ -783,6 +783,10 @@ This setting can be:
|
|
783
783
|
|
784
784
|
# Version Info
|
785
785
|
|
786
|
+
2.5.7<br>
|
787
|
+
Fix problem with schedules being set for plunge periods that are more than 24 hours in the future.
|
788
|
+
Add date to plunge period display.
|
789
|
+
|
786
790
|
2.5.6<br>
|
787
791
|
Change plunge slots to 8 and plungs pricing to [3,10].
|
788
792
|
Change min_hours setting in charge_needed to 0.5 (30 minutes) and round up charge times to increments of this.
|
@@ -0,0 +1,7 @@
|
|
1
|
+
foxesscloud/foxesscloud.py,sha256=KgIasVkQ0jtUemF4jRczfHg3AMTGX3Z3seNN6YOKQTE,211201
|
2
|
+
foxesscloud/openapi.py,sha256=OXJ0_YFX60yes_0L7GCnyIdGfZ7eNptwnsi5NUkMEr4,204841
|
3
|
+
foxesscloud-2.5.7.dist-info/LICENCE,sha256=-3xv8CElCJV8Bc8PbAsg3iyxMpAK8MoJneM3rXigxqI,1074
|
4
|
+
foxesscloud-2.5.7.dist-info/METADATA,sha256=9gTkXkNX3iKhASjDewdprOANQO2Ac9diiE7TUhpnbuw,55827
|
5
|
+
foxesscloud-2.5.7.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
6
|
+
foxesscloud-2.5.7.dist-info/top_level.txt,sha256=IWOrKSNZCLU6IDXSX_b4_bqCfbZoWAT4CC0w0Lg7PuU,12
|
7
|
+
foxesscloud-2.5.7.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
foxesscloud/foxesscloud.py,sha256=pvRR5Wjbb0EIfXT59wtG5kGgGANxV-USjOZoPDzwaL4,210980
|
2
|
-
foxesscloud/openapi.py,sha256=vj0hP-8IsD30IK5ylCqp9BahvhtgYOIbkgrccbjcaLE,204620
|
3
|
-
foxesscloud-2.5.6.dist-info/LICENCE,sha256=-3xv8CElCJV8Bc8PbAsg3iyxMpAK8MoJneM3rXigxqI,1074
|
4
|
-
foxesscloud-2.5.6.dist-info/METADATA,sha256=o3Vxj9OGsJayuifK48DkVlv2W2l4Oht8-KIuzrIB6DU,55678
|
5
|
-
foxesscloud-2.5.6.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
6
|
-
foxesscloud-2.5.6.dist-info/top_level.txt,sha256=IWOrKSNZCLU6IDXSX_b4_bqCfbZoWAT4CC0w0Lg7PuU,12
|
7
|
-
foxesscloud-2.5.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|