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

Fix single sequences being changed to strings #359

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
Fix single sequences being changed to strings
  • Loading branch information
Snuffy2 committed Jan 7, 2025
commit 697f748160dff0d09041b9bc0d8a805ea29d0a36
2 changes: 1 addition & 1 deletion custom_components/opnsense/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ def _handle_coordinator_update(self) -> None:
self._available = True

self._attr_extra_state_attributes = {}
for attr in "device_id":
for attr in ["device_id"]:
self._attr_extra_state_attributes[attr] = temp.get(attr, None)
self.async_write_ha_state()

Expand Down
2 changes: 1 addition & 1 deletion custom_components/opnsense/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ async def _compile_service_switches(
for service in state.get("services", []):
if service.get("locked", 1) == 1:
continue
for prop_name in "status":
for prop_name in ["status"]:
entity = OPNsenseServiceSwitch(
config_entry=config_entry,
coordinator=coordinator,
Expand Down
Loading