mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-24 02:16:14 +00:00
Merge branch 'flobz:master' into feature/#386-mileage-in-charge-table
This commit is contained in:
@@ -51,7 +51,7 @@ class BatteryChargeCurve:
|
||||
start = end
|
||||
speeds = []
|
||||
battery_curves.append(BatteryChargeCurve(charge.end_level, 0))
|
||||
else:
|
||||
elif charge.end_level and charge.start_level:
|
||||
speed = car.get_charge_speed(charge.end_level - charge.start_level, (stop_at - start_date).total_seconds())
|
||||
battery_curves.append(BatteryChargeCurve(charge.start_level, speed))
|
||||
battery_curves.append(BatteryChargeCurve(charge.end_level, speed))
|
||||
|
||||
@@ -335,3 +335,27 @@
|
||||
reg: VR3FPHNSTN.*
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
name: SUV 3008 Hybrid 300
|
||||
battery_power: 13.2
|
||||
fuel_capacity: 43
|
||||
abrp_name:
|
||||
reg: VF3M45GBUK.*
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
name: 508 PSE
|
||||
battery_power: 11.5
|
||||
fuel_capacity: 43
|
||||
abrp_name:
|
||||
reg: VR3F35GBTM.*
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !ElecModel
|
||||
name: Combo-e Life
|
||||
battery_power: 50
|
||||
fuel_capacity: 0
|
||||
abrp_name: opel:comboe:22:50
|
||||
reg: W0VEZZKXZN.*
|
||||
max_elec_consumption: 45
|
||||
|
||||
|
||||
@@ -18,12 +18,13 @@ class Button:
|
||||
self.html_el = self.get_html()
|
||||
self._fct = fct
|
||||
self._output = Output(self.get_response_id(), 'children')
|
||||
callback_id = create_callback_id(self._output)
|
||||
self.input_button = Input(self.get_button_id(), 'n_clicks')
|
||||
callback_id = create_callback_id(self._output, self.input_button)
|
||||
if callback_id not in dash_app.callback_map:
|
||||
self._set_callback(prevent_initial_call)
|
||||
|
||||
def _set_callback(self, prevent_initial_call):
|
||||
dash_app.callback(self._output, Input(self.get_button_id(), 'n_clicks'),
|
||||
dash_app.callback(self._output, self.input_button,
|
||||
prevent_initial_call=prevent_initial_call)(self.call)
|
||||
|
||||
def get_button_id(self):
|
||||
|
||||
@@ -113,7 +113,12 @@ class FigureFilter:
|
||||
return params
|
||||
|
||||
def set_clientside_callback(self, dash_app, config: dict):
|
||||
callback_id = create_callback_id(self.__get_output())
|
||||
output = self.__get_output()
|
||||
inputs = [Input('clientside-data-store', 'data'),
|
||||
Input('date-slider', 'value'),
|
||||
Input('clientside-figure-store', 'data'),
|
||||
*self.__get_table_input_sort_by()]
|
||||
callback_id = create_callback_id(self.__get_output(), inputs)
|
||||
if callback_id not in dash_app.callback_map:
|
||||
config_str = json.dumps(config)
|
||||
if logger.isEnabledFor(DEBUG):
|
||||
@@ -126,12 +131,7 @@ class FigureFilter:
|
||||
return filterAndSort(data, range, figures, params, logLevel,
|
||||
{self.__gen_sort_dict()}, {config_str})
|
||||
}}"""
|
||||
dash_app.clientside_callback(fct_def,
|
||||
*self.__get_output(),
|
||||
Input('clientside-data-store', 'data'),
|
||||
Input('date-slider', 'value'),
|
||||
Input('clientside-figure-store', 'data'),
|
||||
*self.__get_table_input_sort_by())
|
||||
dash_app.clientside_callback(fct_def, *output, *inputs)
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ def askCode(n_clicks): # pylint: disable=unused-argument
|
||||
if ctx.triggered:
|
||||
try:
|
||||
app.myp.remote_client.get_sms_otp_code()
|
||||
return dbc.Alert("Sms sent", color="success")
|
||||
return dbc.Alert("SMS sent", color="success")
|
||||
except Exception as e:
|
||||
res = str(e)
|
||||
return dbc.Alert(res, color="danger")
|
||||
|
||||
+2
-3
@@ -13,7 +13,7 @@ include = [
|
||||
[tool.poetry.dependencies]
|
||||
python = ">=3.7.0, <4.0.0"
|
||||
paho-mqtt = ">=1.5.0"
|
||||
dash = ">2.0.0, <2.9.0"
|
||||
dash = ">=2.9.0, <3.0.0"
|
||||
dash-daq = "^0.5.0"
|
||||
plotly = ">=5"
|
||||
cryptography = ">=2.6"
|
||||
@@ -21,7 +21,6 @@ Werkzeug = ">=1.0.0"
|
||||
Flask = ">=1.0.4"
|
||||
dash-bootstrap-components = ">=1"
|
||||
ConfigUpdater = ">=3.0"
|
||||
pandas = ">=0.23"
|
||||
oauth2-client = "^1.2.1"
|
||||
requests = "^2.27.1"
|
||||
pytz = "^2021.0"
|
||||
@@ -35,7 +34,7 @@ pydantic = "^1.9.0"
|
||||
certifi = ">=14.05.14"
|
||||
six = ">=1.10"
|
||||
python-dateutil = ">=2.5.3"
|
||||
urllib3 = ">=1.15.1"
|
||||
urllib3 = ">=1.15.1 <2.0.0"
|
||||
importlib-metadata = {version = ">=1.7.0", python = "<3.8"}
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
|
||||
Reference in New Issue
Block a user