Skip to content

Commit

Permalink
Auto-format code with Black and isort
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 31, 2024
1 parent adf9a46 commit 31657d8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
1 change: 0 additions & 1 deletion apps/pv_opt/pv_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2378,7 +2378,6 @@ def optimise(self):
)
soc_now = soc_last_day.iloc[-1]


# x = x.astype(float)

try:
Expand Down
6 changes: 0 additions & 6 deletions apps/pv_opt/pvpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import requests
from numpy import isnan


OCTOPUS_PRODUCT_URL = r"https://api.octopus.energy/v1/products/"
AGILE_PREDICT_URL = r"https://agilepredict.com/api/"

Expand Down Expand Up @@ -356,7 +355,6 @@ def to_df(self, start=None, end=None, **kwargs):
]
)


# If the index frequency >30 minutes so we need to just extend it:
if (len(df) > 1 and ((df.index[-1] - df.index[-2]).total_seconds() / 60) > 30) or len(df) == 1:
newindex = pd.date_range(df.index[0], end, freq="30min")
Expand Down Expand Up @@ -1003,7 +1001,6 @@ def _high_cost_swaps(self, log=True):
search_window = self._search_window(self.flows, available, max_slot)
str_log += f" {round_trip_energy_required:5.2f} kWh at {max_import_cost:6.2f}p. "


if len(search_window) > 0:
min_price = search_window["import"].min()

Expand Down Expand Up @@ -1031,7 +1028,6 @@ def _high_cost_swaps(self, log=True):
((100 - search_window["soc_end"].loc[slot]) / 100 * self.battery.capacity)
* 2
* factor,

0,
)
min_power = min(
Expand All @@ -1049,7 +1045,6 @@ def _high_cost_swaps(self, log=True):
str_log_x = (
f">>> {i:3d} Slot: {slot.strftime(TIME_FORMAT)} Factor: {factor:0.3f} Forced: {search_window['forced'].loc[slot]:6.0f}W "
+ f"End SOC: {search_window['soc_end'].loc[slot]:4.1f}% SPR: {slot_power_required:6.0f}W "

+ f"SCPA: {slot_charger_power_available:6.0f}W SAC: {slot_available_capacity:6.0f}W Min Power: {min_power:6.0f}W "
+ f"RSC: {remaining_slot_capacity:6.0f}W"
)
Expand Down Expand Up @@ -1223,7 +1218,6 @@ def _low_cost_charging(self, log=True):
self.slots_added = slots_added
self.best_cost = best_cost


if log:
self.log("")
self.log(str_log)
Expand Down
5 changes: 2 additions & 3 deletions apps/pv_opt/solis.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ def create_inverter_controller(inverter_type: str, host):
host=host,
)


elif inverter_type == "SOLIS_CLOUD":
return SolisCloudInverter(
inverter_type=inverter_type,
Expand Down Expand Up @@ -386,6 +385,7 @@ def hold_soc(self, enable, target_soc=None, **kwargs):

def get_config(self, config_variable, default=None):
return self._host.get_config(config_variable, default)

@property
@abstractmethod
def status(self):
Expand Down Expand Up @@ -667,8 +667,7 @@ def _set_target_soc(self, direction, target_soc: int = 100, forced=True) -> bool
tolerance = 0

if entity_id is not None:
changed, written = self.write_to_hass(
)
changed, written = self.write_to_hass()

if changed:
if written:
Expand Down

0 comments on commit 31657d8

Please sign in to comment.