Skip to content

Commit

Permalink
Returning old auto detection of enabled partitions for EVOs.
Browse files Browse the repository at this point in the history
  • Loading branch information
yozik04 committed Aug 23, 2020
1 parent db63336 commit 8288592
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 30 deletions.
13 changes: 0 additions & 13 deletions paradox/hardware/evo/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,6 @@ def __init__(

self._populate_settings(start_communication_response)

enabled_partitions = list(
(key for key, val in self.settings.system_options.partitions.items() if val)
)

if hasattr(cfg, "LIMITS"):
partition_limits = cfg.LIMITS.get("partition")
if partition_limits is None:
cfg.LIMITS["partition"] = enabled_partitions
else:
cfg.LIMITS["partition"] = list(
set(cfg.LIMITS["partition"]).intersection(enabled_partitions)
)

def _populate_settings(self, start_communication_response):
raw_data = (
start_communication_response.fields.data
Expand Down
34 changes: 17 additions & 17 deletions paradox/hardware/evo/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,23 +391,23 @@ def get_user_definition(settings):
)
),
),
# "partition": BitsSwapped( # No need as we get this data during connect in InitializeCommunication system_options
# Bitwise(
# DictArray(
# 8,
# 1,
# Struct(
# "_index" / Computed(this._index + 1),
# "definition"
# / ExprAdapter(
# Default(Flag, False),
# lambda obj, context: "enabled" if obj else "disabled",
# lambda obj, context: obj == "enabled",
# ),
# ),
# )
# )
# ),
"partition": BitsSwapped( # No need as we get this data during connect in InitializeCommunication system_options
Bitwise(
DictArray(
8,
1,
Struct(
"_index" / Computed(this._index + 1),
"definition"
/ ExprAdapter(
Default(Flag, False),
lambda obj, context: "enabled" if obj else "disabled",
lambda obj, context: obj == "enabled",
),
),
)
)
),
"user": get_user_definition,
}

Expand Down

0 comments on commit 8288592

Please sign in to comment.