Skip to content

Commit

Permalink
Merge pull request #1767 from openWB/feature-cards-display-theme
Browse files Browse the repository at this point in the history
Feature cards display theme
  • Loading branch information
benderl authored Jul 19, 2024
2 parents 1f448d1 + c9eaf9f commit 9656c22
Show file tree
Hide file tree
Showing 103 changed files with 3,882 additions and 2,829 deletions.
16 changes: 15 additions & 1 deletion packages/helpermodules/update_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@


class UpdateConfig:
DATASTORE_VERSION = 52
DATASTORE_VERSION = 53
valid_topic = [
"^openWB/bat/config/configured$",
"^openWB/bat/set/charging_power_left$",
Expand Down Expand Up @@ -1626,3 +1626,17 @@ def upgrade(topic: str, payload) -> None:
Pub().pub(topic, payload)
self._loop_all_received_topics(upgrade)
self.__update_topic("openWB/system/datastore_version", 52)


def upgrade_datastore_52(self) -> None:
def upgrade(topic: str, payload) -> Optional[dict]:
if "openWB/optional/int_display/theme" == topic:
configuration_payload = decode_payload(payload)
if configuration_payload.get("type") == "cards":
configuration_payload["configuration"].update({
"enable_energy_flow_view": True,
"enable_dashboard_card_vehicles": True,
})
return {topic: configuration_payload}
self._loop_all_received_topics(upgrade)
self.__update_topic("openWB/system/datastore_version", 51)
7 changes: 7 additions & 0 deletions packages/modules/display_themes/cards/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ def __init__(self,
enable_dashboard_card_battery_sum: bool = True,
enable_dashboard_card_inverter_sum: bool = True,
enable_dashboard_card_charge_point_sum: bool = True,
enable_dashboard_card_vehicles: bool = True,
enable_energy_flow_view: bool = True,
enable_charge_points_view: bool = True,
simple_charge_point_view: bool = False,
enable_status_view: bool = True) -> None:
# display lock settings
self.lock_changes = lock_changes
Expand All @@ -27,8 +30,12 @@ def __init__(self,
self.enable_dashboard_card_battery_sum = enable_dashboard_card_battery_sum
self.enable_dashboard_card_inverter_sum = enable_dashboard_card_inverter_sum
self.enable_dashboard_card_charge_point_sum = enable_dashboard_card_charge_point_sum
self.enable_dashboard_card_vehicles = enable_dashboard_card_vehicles
# energy flow settings
self.enable_energy_flow_view = enable_energy_flow_view
# charge point settings
self.enable_charge_points_view = enable_charge_points_view
self.simple_charge_point_view = simple_charge_point_view
# state settings
self.enable_status_view = enable_status_view

Expand Down
14 changes: 0 additions & 14 deletions packages/modules/display_themes/cards/source/.eslintrc.cjs

This file was deleted.

13 changes: 13 additions & 0 deletions packages/modules/display_themes/cards/source/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import js from "@eslint/js"
import pluginVue from "eslint-plugin-vue"

export default [
js.configs.recommended,
...pluginVue.configs['flat/recommended'],
{
files: ["**/*.{vue,js,jsx,cjs,mjs}"],
languageOptions: {
ecmaVersion: "latest",
},
}
]
Loading

0 comments on commit 9656c22

Please sign in to comment.