Skip to content

Commit

Permalink
humanize device state
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhawksley committed Jan 25, 2025
1 parent ef8daa2 commit 1c31c13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/apis/home_assistant_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def problems

{
icon: icon.tr("_", "-"),
message: _1[:state]
message: _1[:state].humanize
}
end
end.compact
Expand Down
2 changes: 1 addition & 1 deletion test/apis/home_assistant_api_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def test_problems
end

def test_problems_non_binary
data = [{entity_id: "sensor.timeframe0print0printer_ink_low", state: "Ink low"}]
data = [{entity_id: "sensor.timeframe0print0printer_ink_low", state: "ink_low"}]

api = HomeAssistantApi.new({})
api.stub :data, data do
Expand Down

0 comments on commit 1c31c13

Please sign in to comment.