foxesscloud 2.6.3__tar.gz → 2.6.4__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foxesscloud
3
- Version: 2.6.3
3
+ Version: 2.6.4
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
@@ -787,7 +787,7 @@ This setting can be:
787
787
 
788
788
  # Version Info
789
789
 
790
- 2.6.3<br>
790
+ 2.6.4<br>
791
791
  Increase default plungs_slots from 6 to 8.
792
792
  Correct battery capacity in get_batteries().
793
793
 
@@ -773,7 +773,7 @@ This setting can be:
773
773
 
774
774
  # Version Info
775
775
 
776
- 2.6.3<br>
776
+ 2.6.4<br>
777
777
  Increase default plungs_slots from 6 to 8.
778
778
  Correct battery capacity in get_batteries().
779
779
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "foxesscloud"
7
- version = "2.6.3"
7
+ version = "2.6.4"
8
8
  authors = [
9
9
  {name="Tony Matthews", email="tony@quasair.co.uk"},
10
10
  ]
@@ -10,7 +10,7 @@ By: Tony Matthews
10
10
  # ALL RIGHTS ARE RESERVED © Tony Matthews 2023
11
11
  ##################################################################################################
12
12
 
13
- version = "1.7.5"
13
+ version = "1.7.6"
14
14
  print(f"FoxESS-Cloud version {version}")
15
15
 
16
16
  debug_setting = 1
@@ -690,29 +690,26 @@ def get_batteries(info=1):
690
690
  b['residual_handling'] = residual_handling
691
691
  if b.get('info') is not None and b['info']['masterVersion'] >= '1.014' and b['info']['masterSN'][:7] == '60BBHV2':
692
692
  b['residual_handling'] = 2
693
- if b.get('soh') is not None and b['soh'].isnumeric():
694
- b['soh'] = int(b['soh'])
695
- b['soh_supported'] = True
696
- else:
697
- b['rated_capacity'] = None
698
- b['soh'] = None
699
- b['soh_supported'] = False
693
+ rated_capacity = b.get('ratedCapacity')
694
+ b['ratedCapacity'] = rated_capacity if rated_capacity is not None and rated_capacity > 100 else None
695
+ soh = b.get('soh')
696
+ b['soh'] = int(soh) if soh.isnumeric() and int(soh) > 10 else None
697
+ b['soh_supported'] = b['soh'] is not None
700
698
  for i, b in enumerate(batteries):
701
699
  if i == 0:
702
700
  residual_handling = b['residual_handling']
703
701
  get_battery(info=0)
704
- battery['ratedCapacity'] = b.get('ratedCapacity')
705
702
  b['capacity'] = battery.get('capacity')
706
703
  b['residual'] = battery.get('residual')
707
704
  b['soc'] = battery.get('soc')
708
- if b.get('capacity') is None and b.get('soh') is not None:
709
- capacity = (b['ratedCapacity'] / 1000 * b['soh'] / 100)
705
+ if b.get('capacity') is None and b.get('ratedCapacity') is not None and b.get('soh') is not None:
706
+ b['capacity'] = round(b['ratedCapacity'] / 1000 * b['soh'] / 100, 3)
707
+ if b.get('residual') is None and b.get('capacity') is not None and b.get('soc') is not None:
710
708
  soc = b.get('soc')
711
- residual = capacity * soc / 100 if capacity is not None and soc is not None else capacity
712
- b['capacity'] = round(capacity, 3)
709
+ residual = b['capacity'] * b['soc'] / 100
713
710
  b['residual'] = round(residual, 3)
714
711
  if b.get('capacity') is not None and b.get('ratedCapacity') is not None:
715
- b['soh'] = round(b['capacity'] / b['ratedCapacity'] * 1000 * 100, 1)
712
+ b['soh'] = round(b['capacity'] * 1000 / b['ratedCapacity'] * 100, 1)
716
713
  b['charge_rate'] = 50
717
714
  params = battery_params[b['residual_handling']]
718
715
  b['charge_loss'] = params['charge_loss']
@@ -2418,9 +2415,9 @@ def get_agile_times(tariff=agile_octopus, d=None):
2418
2415
  plunge = []
2419
2416
  plunge_price = tariff_config['plunge_price'] if tariff_config.get('plunge_price') is not None else 2
2420
2417
  plunge_price = [plunge_price] if type(plunge_price) is not list else plunge_price
2421
- plunge_slots = tariff_config['plunge_slots'] if tariff_config.get('plunge_slots') is not None else 6
2418
+ plunge_slots = tariff_config['plunge_slots'] if tariff_config.get('plunge_slots') is not None else 8
2422
2419
  for i in range(0, len(prices)):
2423
- # hour relative index into list of plunge prices, starting at 7am
2420
+ # hour relative index into list of plunge prices and slots, starting at 7am
2424
2421
  x = int(((now.hour - 7 + i / 2) % 24) * len(plunge_price) / 24)
2425
2422
  if prices[i] is not None and prices[i]['price'] < plunge_price[x]:
2426
2423
  plunge.append(i)
@@ -10,7 +10,7 @@ By: Tony Matthews
10
10
  # ALL RIGHTS ARE RESERVED © Tony Matthews 2024
11
11
  ##################################################################################################
12
12
 
13
- version = "2.6.3"
13
+ version = "2.6.4"
14
14
  print(f"FoxESS-Cloud Open API version {version}")
15
15
 
16
16
  debug_setting = 1
@@ -2219,7 +2219,7 @@ def get_agile_times(tariff=agile_octopus, d=None):
2219
2219
  plunge = []
2220
2220
  plunge_price = tariff_config['plunge_price'] if tariff_config.get('plunge_price') is not None else 2
2221
2221
  plunge_price = [plunge_price] if type(plunge_price) is not list else plunge_price
2222
- plunge_slots = tariff_config['plunge_slots'] if tariff_config.get('plunge_slots') is not None else 6
2222
+ plunge_slots = tariff_config['plunge_slots'] if tariff_config.get('plunge_slots') is not None else 8
2223
2223
  for i in range(0, len(prices)):
2224
2224
  # hour relative index into list of plunge prices, starting at 7am
2225
2225
  x = int(((now.hour - 7 + i / 2) % 24) * len(plunge_price) / 24)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foxesscloud
3
- Version: 2.6.3
3
+ Version: 2.6.4
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
@@ -787,7 +787,7 @@ This setting can be:
787
787
 
788
788
  # Version Info
789
789
 
790
- 2.6.3<br>
790
+ 2.6.4<br>
791
791
  Increase default plungs_slots from 6 to 8.
792
792
  Correct battery capacity in get_batteries().
793
793
 
File without changes
File without changes