Skip to content

fix: replace string.Equals with ToUpper comparison in SwitchesController#94

Merged
sondresjolyst merged 1 commit intodevelopmentfrom
fix/switches-ef-core-linq-translation
Apr 16, 2026
Merged

fix: replace string.Equals with ToUpper comparison in SwitchesController#94
sondresjolyst merged 1 commit intodevelopmentfrom
fix/switches-ef-core-linq-translation

Conversation

@sondresjolyst
Copy link
Copy Markdown
Owner

Problem

GetAllSwitches was crashing with a 500 error because EF Core cannot translate string.Equals with StringComparison to SQL.

Fix

Replaced .Equals with .ToUpper() == "SOCKET" which EF Core can translate to valid SQL.

@sondresjolyst sondresjolyst merged commit c57d661 into development Apr 16, 2026
1 check passed
@sondresjolyst sondresjolyst deleted the fix/switches-ef-core-linq-translation branch April 16, 2026 05:56
sondresjolyst added a commit that referenced this pull request Apr 16, 2026
…ler (#94) (#95)

* fix(switches): whitelist SOCKET type in GET /api/switches

Only return switches with type 'SOCKET'. This excludes SHRGBC light
bulbs and any other unknown device types, keeping the list to
actionable socket devices only.

* fix: replace string.Equals with ToUpper comparison in SwitchesController (#94)
sondresjolyst added a commit that referenced this pull request Apr 18, 2026
* fix: replace string.Equals with ToUpper comparison in SwitchesController (#94) (#95)

* fix(switches): whitelist SOCKET type in GET /api/switches

Only return switches with type 'SOCKET'. This excludes SHRGBC light
bulbs and any other unknown device types, keeping the list to
actionable socket devices only.

* fix: replace string.Equals with ToUpper comparison in SwitchesController (#94)

* chore(main): release 1.7.2 (#96)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* feat!: rename roles

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant