Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix #1149

Merged
merged 3 commits into from
Oct 6, 2023
Merged

Bugfix #1149

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/helpermodules/subdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import logging
from pathlib import Path
import threading
from typing import Dict
from typing import Dict, Union
import re
import subprocess
import paho.mqtt.client as mqtt
Expand Down Expand Up @@ -56,7 +56,7 @@ class SubData:
bat_all_data = bat_all.BatAll()
bat_data: Dict[str, bat.Bat] = {}
general_data = general.General()
internal_chargepoint_data: Dict[str, InternalChargepointHandlerData] = {
internal_chargepoint_data: Dict[str, Union[InternalChargepointHandlerData, GlobalHandlerData, RfidData]] = {
"cp0": InternalChargepointHandlerData(),
"cp1": InternalChargepointHandlerData(),
"global_data": GlobalHandlerData(),
Expand Down Expand Up @@ -719,6 +719,7 @@ def process_system_topic(self, client: mqtt.Client, var: dict, msg: mqtt.MQTTMes
log.debug("skipping mqtt bridge message on startup")
# will be moved to separate handler!
elif "GetRemoteSupport" in msg.topic:
log.warning("deprecated topic for remote support received!")
payload = decode_payload(msg.payload)
splitted = payload.split(";")
token = splitted[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ def _pub_values_to_2(self, topic: str, value) -> None:
else:
payload = rounding(value)
pub_single(f"openWB/set/chargepoint/{self.parent_cp}/get/{topic}", payload=payload, hostname=self.parent_ip)
pub_single(f"openWB/set/chargepoint/{self.hierarchy_id}/get/state_str",
payload="Statusmeldungen bitte auf der Primary-openWB einsehen.")
if self.parent_ip != "localhost":
pub_single(f"openWB/set/chargepoint/{self.hierarchy_id}/get/state_str",
payload="Statusmeldungen bitte auf der Primary-openWB einsehen.")


class UpdateState:
Expand Down
4 changes: 2 additions & 2 deletions packages/modules/vehicles/bmw/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ def dump_json(data: dict, fout: str):
json.dump(data, f, ensure_ascii=False, indent=4)
f.close()
try:
os.chmod(replyFile, 0o777)
os.chmod(replyFile, 0o666)
except Exception as e:
log.debug("bmw.dump_json: chmod replyFile " + replyFile + ", exception, e=" + str(e))
log.debug("bmw.dump_json: use sudo, user: " + getpass.getuser())
os.system("sudo chmod 0777 " + replyFile)
os.system("sudo chmod 0666 " + replyFile)


# ---------------Helper Function-------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions packages/modules/vehicles/smarteq/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ def write_store(self):
pickle.dump(self.store, tf)
tf.close()
try:
os.chmod(self.storeFile, 0o777)
os.chmod(self.storeFile, 0o666)
except Exception:
log.exception("chmod_store")
os.system("sudo chmod 0777 " + self.storeFile)
os.system("sudo chmod 0666 " + self.storeFile)

# ===== get resume string ======
def get_resume(self) -> str:
Expand Down