foxesscloud 2.9.3__tar.gz → 2.9.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.9.3
3
+ Version: 2.9.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
@@ -118,7 +118,7 @@ f.get_peakshaving()
118
118
  f.get_flag()
119
119
  f.get_schedule()
120
120
  f.get_named_settings(name)
121
- f.get_battery_heating()
121
+ f.get_heating()
122
122
 
123
123
  ```
124
124
  Each of these calls will return a dictionary or list containing the relevant information.
@@ -147,7 +147,7 @@ get_named_settings() returns the value of a named setting. If 'name' is a list,
147
147
  + f.named_settings is updated. This is dictionary of information and current value, indexed by 'name'.
148
148
  + named_settings currently available are stored in f.name_list. The settings supported depends on the inverter model and firmware version. An error will be returned if an unsupported variable is used.
149
149
 
150
- get_battery_heating returns the current battery heating parameters and store these in f.battery_heating
150
+ get_heating returns the current battery heating parameters and store these in f.device['heating']
151
151
 
152
152
  ## Inverter Settings
153
153
  You can change inverter settings using:
@@ -158,7 +158,7 @@ f.set_charge(ch1, st1, en1, ch2, st2, en2, enable)
158
158
  f.set_period(start, end, mode, min_soc, max_soc, fdsoc, fdpwr, price, segment)
159
159
  f.set_schedule(periods, enable)
160
160
  f.set_named_settings(name, value, force)
161
- f.set_battery_heating(enable, start, end, time1, time2, time3)
161
+ f.set_heating(enable, start, end, time1, time2, time3)
162
162
  ```
163
163
 
164
164
  set_min() applies new SoC settings to the inverter. The parameters update battery_settings:
@@ -201,7 +201,7 @@ set_named_settings() sets the 'name' setting to 'value'.
201
201
  + a return value of 1 is success. 0 means setting failed. None is another error e.g. device not found, invalid name or value.
202
202
  + named_settings currently available are stored in f.name_list. The settings supported depend on the inverter model and firmware version. An error will be returned if an unsupported varaible is used.
203
203
 
204
- set_battery_heating() set the heating parameters as follows:
204
+ set_heating() set the heating parameters as follows:
205
205
  + enable: optional, 0 or 1, default is 1
206
206
  + start, end: optional start and end temperatures. The defaults are start at 9C and end at 12C.
207
207
  + time1, time2, time3: optional times when the battery can heat from the grid time. The structure is {'enable': 1, 'start': '00:30', 'end': '05:30'}. The time slot is disabled by default.
@@ -830,6 +830,10 @@ This setting can be:
830
830
 
831
831
  # Version Info
832
832
 
833
+ 2.9.4 - 2026/01/22<br>
834
+ Rename get_battery_heating(), set_battery_heating() to get_heating() and set_heating().
835
+ Update get_heating() to return a dictionary to simplify parameter access.
836
+
833
837
  2.9.3 - 2026/01/18<br>
834
838
  Update get_device() to use v1 API call.
835
839
  Update get_battery() to work out battery count and rated capacity from device battery list.
@@ -104,7 +104,7 @@ f.get_peakshaving()
104
104
  f.get_flag()
105
105
  f.get_schedule()
106
106
  f.get_named_settings(name)
107
- f.get_battery_heating()
107
+ f.get_heating()
108
108
 
109
109
  ```
110
110
  Each of these calls will return a dictionary or list containing the relevant information.
@@ -133,7 +133,7 @@ get_named_settings() returns the value of a named setting. If 'name' is a list,
133
133
  + f.named_settings is updated. This is dictionary of information and current value, indexed by 'name'.
134
134
  + named_settings currently available are stored in f.name_list. The settings supported depends on the inverter model and firmware version. An error will be returned if an unsupported variable is used.
135
135
 
136
- get_battery_heating returns the current battery heating parameters and store these in f.battery_heating
136
+ get_heating returns the current battery heating parameters and store these in f.device['heating']
137
137
 
138
138
  ## Inverter Settings
139
139
  You can change inverter settings using:
@@ -144,7 +144,7 @@ f.set_charge(ch1, st1, en1, ch2, st2, en2, enable)
144
144
  f.set_period(start, end, mode, min_soc, max_soc, fdsoc, fdpwr, price, segment)
145
145
  f.set_schedule(periods, enable)
146
146
  f.set_named_settings(name, value, force)
147
- f.set_battery_heating(enable, start, end, time1, time2, time3)
147
+ f.set_heating(enable, start, end, time1, time2, time3)
148
148
  ```
149
149
 
150
150
  set_min() applies new SoC settings to the inverter. The parameters update battery_settings:
@@ -187,7 +187,7 @@ set_named_settings() sets the 'name' setting to 'value'.
187
187
  + a return value of 1 is success. 0 means setting failed. None is another error e.g. device not found, invalid name or value.
188
188
  + named_settings currently available are stored in f.name_list. The settings supported depend on the inverter model and firmware version. An error will be returned if an unsupported varaible is used.
189
189
 
190
- set_battery_heating() set the heating parameters as follows:
190
+ set_heating() set the heating parameters as follows:
191
191
  + enable: optional, 0 or 1, default is 1
192
192
  + start, end: optional start and end temperatures. The defaults are start at 9C and end at 12C.
193
193
  + time1, time2, time3: optional times when the battery can heat from the grid time. The structure is {'enable': 1, 'start': '00:30', 'end': '05:30'}. The time slot is disabled by default.
@@ -816,6 +816,10 @@ This setting can be:
816
816
 
817
817
  # Version Info
818
818
 
819
+ 2.9.4 - 2026/01/22<br>
820
+ Rename get_battery_heating(), set_battery_heating() to get_heating() and set_heating().
821
+ Update get_heating() to return a dictionary to simplify parameter access.
822
+
819
823
  2.9.3 - 2026/01/18<br>
820
824
  Update get_device() to use v1 API call.
821
825
  Update get_battery() to work out battery count and rated capacity from device battery list.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "foxesscloud"
7
- version = "2.9.3"
7
+ version = "2.9.4"
8
8
  authors = [
9
9
  {name="Tony Matthews", email="tony@quasair.co.uk"},
10
10
  ]
@@ -1,7 +1,7 @@
1
1
  ##################################################################################################
2
2
  """
3
3
  Module: Fox ESS Cloud using Open API
4
- Updated: 18 January 2025
4
+ Updated: 19 January 2025
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.9.3"
13
+ version = "2.9.4"
14
14
  print(f"FoxESS-Cloud Open API version {version}")
15
15
 
16
16
  debug_setting = 1
@@ -692,10 +692,8 @@ def get_battery_real():
692
692
  # battery heating settings
693
693
  ##################################################################################################
694
694
 
695
- battery_heating = None
696
-
697
- def get_battery_heating():
698
- global device_sn, device, battery_heating
695
+ def get_heating():
696
+ global device_sn, device
699
697
  if get_device() is None:
700
698
  return None
701
699
  output(f"getting battery heating", 2)
@@ -705,42 +703,59 @@ def get_battery_heating():
705
703
  output(f"** get_battery_heating() got response code {response.status_code}: {response.reason}")
706
704
  return None
707
705
  errno = response.json().get('errno')
708
- if errno != 0:
709
- if errno == 41200:
710
- output(f"** get_battery_heating(): not supported")
711
- else:
712
- output(f"** get_battery_heating(): {errno_message(response)}")
713
- return None
714
706
  result = response.json().get('result')
715
- battery_heating = result
716
- return result
707
+ if errno != 0 and errno != 41200:
708
+ output(f"** get_battery_heating(): {errno_message(response)}")
709
+ return None
710
+ if result is None:
711
+ items = None
712
+ else:
713
+ items = {'result': result}
714
+ for i in result['dataList']:
715
+ n = i['name']
716
+ if 'time' in n:
717
+ j = n[:5]
718
+ if items.get(j) is None:
719
+ items[j] = {'enable': 0, 'start': 0.0, 'end': 0.0}
720
+ k = 'end' if 'End' in n else 'start' if 'Start' in n else 'enable'
721
+ if k == 'enable':
722
+ items[j]['enable'] = 0 if i['value'] == 'disable' else 1
723
+ else:
724
+ t = (int(i['value']) / 60) if 'Minute' in n else int(i['value'])
725
+ items[j][k] += t
726
+ else:
727
+ items[i['name']] = i['value']
728
+ device['heating'] = items
729
+ return items
717
730
 
718
731
  def set_time(body, s, time):
719
732
  if time is None:
720
- body[s + 'Enable'] = 0
721
- body[s + 'StartHour'] = 0
722
- body[s + 'StartMinute'] = 0
723
- body[s + 'EndHour'] = 0
724
- body[s + 'EndMinute'] = 0
733
+ body[s + 'Enable'] = 'disable'
734
+ body[s + 'StartHour'] = '0'
735
+ body[s + 'StartMinute'] = '0'
736
+ body[s + 'EndHour'] = '0'
737
+ body[s + 'EndMinute'] = '0'
725
738
  else:
726
- body[s + 'Enable'] = time['enable']
739
+ body[s + 'Enable'] = 'enable' if time['enable'] == 1 else 'disable'
727
740
  t = time_hours(time['start'])
728
- body[s + 'StartHour'] = int(t)
729
- body[s + 'StartMinute'] = int(60 * (t - int(t)) + 0.5)
741
+ body[s + 'StartHour'] = str(int(t))
742
+ body[s + 'StartMinute'] = str(int(60 * (t - int(t)) + 0.5))
730
743
  t = time_hours(time['end'])
731
- body[s + 'EndHour'] = int(t)
732
- body[s + 'EndMinute'] = int(60 * (t - int(t)) + 0.5)
744
+ body[s + 'EndHour'] = str(int(t))
745
+ body[s + 'EndMinute'] = str(int(60 * (t - int(t)) + 0.5))
733
746
  return
734
747
 
735
- def set_battery_heating(enable=None, start=None, end=None, time1=None, time2=None, time3=None):
748
+ def set_heating(enable=None, start=None, end=None, time1=None, time2=None, time3=None):
736
749
  global device_sn, device
737
750
  if get_device() is None:
738
751
  return None
752
+ if get_heating() is None:
753
+ return 0
739
754
  output(f"setting battery heating", 2)
740
755
  body = {'sn': device_sn}
741
- body['batteryWarmUpEnable'] = enable if enable is not None else 1
742
- body['startTemperature'] = start if start is not None else 9
743
- body['endTemperature'] = end if end is not None else 12
756
+ body['batteryWarmUpEnable'] = 'disable' if enable is not None and enable == 0 else 'enable'
757
+ body['startTemperature'] = str(start if start is not None else 9)
758
+ body['endTemperature'] = str(end if end is not None else 12)
744
759
  set_time(body, 'time1', time1)
745
760
  set_time(body, 'time2', time2)
746
761
  set_time(body, 'time3', time3)
@@ -750,11 +765,8 @@ def set_battery_heating(enable=None, start=None, end=None, time1=None, time2=Non
750
765
  return None
751
766
  errno = response.json().get('errno')
752
767
  if errno != 0:
753
- if errno == 41200:
754
- output(f"** set_battery_heating(): not supported")
755
- else:
756
- output(f"** set_battery_heating(): {errno_message(response)}")
757
- return None
768
+ output(f"** set_battery_heating(): {errno_message(response)}")
769
+ return 0
758
770
  return 1
759
771
 
760
772
  ##################################################################################################
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foxesscloud
3
- Version: 2.9.3
3
+ Version: 2.9.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
@@ -118,7 +118,7 @@ f.get_peakshaving()
118
118
  f.get_flag()
119
119
  f.get_schedule()
120
120
  f.get_named_settings(name)
121
- f.get_battery_heating()
121
+ f.get_heating()
122
122
 
123
123
  ```
124
124
  Each of these calls will return a dictionary or list containing the relevant information.
@@ -147,7 +147,7 @@ get_named_settings() returns the value of a named setting. If 'name' is a list,
147
147
  + f.named_settings is updated. This is dictionary of information and current value, indexed by 'name'.
148
148
  + named_settings currently available are stored in f.name_list. The settings supported depends on the inverter model and firmware version. An error will be returned if an unsupported variable is used.
149
149
 
150
- get_battery_heating returns the current battery heating parameters and store these in f.battery_heating
150
+ get_heating returns the current battery heating parameters and store these in f.device['heating']
151
151
 
152
152
  ## Inverter Settings
153
153
  You can change inverter settings using:
@@ -158,7 +158,7 @@ f.set_charge(ch1, st1, en1, ch2, st2, en2, enable)
158
158
  f.set_period(start, end, mode, min_soc, max_soc, fdsoc, fdpwr, price, segment)
159
159
  f.set_schedule(periods, enable)
160
160
  f.set_named_settings(name, value, force)
161
- f.set_battery_heating(enable, start, end, time1, time2, time3)
161
+ f.set_heating(enable, start, end, time1, time2, time3)
162
162
  ```
163
163
 
164
164
  set_min() applies new SoC settings to the inverter. The parameters update battery_settings:
@@ -201,7 +201,7 @@ set_named_settings() sets the 'name' setting to 'value'.
201
201
  + a return value of 1 is success. 0 means setting failed. None is another error e.g. device not found, invalid name or value.
202
202
  + named_settings currently available are stored in f.name_list. The settings supported depend on the inverter model and firmware version. An error will be returned if an unsupported varaible is used.
203
203
 
204
- set_battery_heating() set the heating parameters as follows:
204
+ set_heating() set the heating parameters as follows:
205
205
  + enable: optional, 0 or 1, default is 1
206
206
  + start, end: optional start and end temperatures. The defaults are start at 9C and end at 12C.
207
207
  + time1, time2, time3: optional times when the battery can heat from the grid time. The structure is {'enable': 1, 'start': '00:30', 'end': '05:30'}. The time slot is disabled by default.
@@ -830,6 +830,10 @@ This setting can be:
830
830
 
831
831
  # Version Info
832
832
 
833
+ 2.9.4 - 2026/01/22<br>
834
+ Rename get_battery_heating(), set_battery_heating() to get_heating() and set_heating().
835
+ Update get_heating() to return a dictionary to simplify parameter access.
836
+
833
837
  2.9.3 - 2026/01/18<br>
834
838
  Update get_device() to use v1 API call.
835
839
  Update get_battery() to work out battery count and rated capacity from device battery list.
File without changes
File without changes