Skip to content
Merged
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
1 change: 1 addition & 0 deletions custom_components/tronbytassistant/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class TronbytConfigSelectDescription:
"min": 1,
"max": 2,
},
entity_registry_enabled_default=False,
Comment thread
gabe565 marked this conversation as resolved.
Resolved
),
)

Expand Down
4 changes: 4 additions & 0 deletions custom_components/tronbytassistant/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,31 @@ class TronbytSwitchDescription:
icon="mdi:counter",
value_fn=lambda device: (device.get("info") or {}).get("skip_display_version"),
patch_key="skipDisplayVersion",
entity_registry_enabled_default=False,
Comment thread
gabe565 marked this conversation as resolved.
Resolved
),
TronbytSwitchDescription(
key="ap_mode",
translation_key="ap_mode",
icon="mdi:access-point",
value_fn=lambda device: (device.get("info") or {}).get("ap_mode"),
patch_key="apMode",
entity_registry_enabled_default=False,
),
TronbytSwitchDescription(
key="prefer_ipv6",
translation_key="prefer_ipv6",
icon="mdi:ip-network",
value_fn=lambda device: (device.get("info") or {}).get("prefer_ipv6"),
patch_key="preferIPv6",
entity_registry_enabled_default=False,
),
TronbytSwitchDescription(
key="swap_colors",
translation_key="swap_colors",
icon="mdi:palette-swatch",
value_fn=lambda device: (device.get("info") or {}).get("swap_colors"),
patch_key="swapColors",
entity_registry_enabled_default=False,
),
)

Expand Down
5 changes: 5 additions & 0 deletions custom_components/tronbytassistant/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,39 @@ class TronbytTextDescription:
icon="mdi:wifi",
value_fn=lambda device: (device.get("info") or {}).get("ssid"),
patch_key="ssid",
entity_registry_enabled_default=False,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since all entities in TEXT_DESCRIPTIONS are being disabled, it would be cleaner to change the default value of entity_registry_enabled_default to False in the TronbytTextDescription dataclass (line 24) and remove the explicit assignments from the individual descriptions.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. I'm going to prefer being explicit here.

),
TronbytTextDescription(
key="image_url",
translation_key="image_url",
icon="mdi:image",
value_fn=lambda device: (device.get("info") or {}).get("image_url"),
patch_key="imageUrl",
entity_registry_enabled_default=False,
),
TronbytTextDescription(
key="hostname",
translation_key="hostname",
icon="mdi:rename-box",
value_fn=lambda device: (device.get("info") or {}).get("hostname"),
patch_key="hostname",
entity_registry_enabled_default=False,
),
TronbytTextDescription(
key="sntp_server",
translation_key="sntp_server",
icon="mdi:clock-time-four-outline",
value_fn=lambda device: (device.get("info") or {}).get("sntp_server"),
patch_key="sntpServer",
entity_registry_enabled_default=False,
),
TronbytTextDescription(
key="syslog_addr",
translation_key="syslog_addr",
icon="mdi:file-document-outline",
value_fn=lambda device: (device.get("info") or {}).get("syslog_addr"),
patch_key="syslogAddr",
entity_registry_enabled_default=False,
),
)

Expand Down
Loading