Skip to content

Commit 19651e2

Browse files
committed
exclude ignored unavailable entities
1 parent 46b2a77 commit 19651e2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/apis/home_assistant_api.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ def problems
4444
end.compact
4545

4646
unavailable_entity_problems = data
47-
.select { _1[:state] == "unavailable" && Time.parse(_1[:last_updated].to_s) < 15.minutes.ago }
48-
.map do
47+
.select {
48+
_1[:state] == "unavailable" &&
49+
Time.parse(_1[:last_updated].to_s) < 15.minutes.ago &&
50+
!@config.dig("home_assistant", "allowed_unavailable").to_a.include?(_1[:entity_id])
51+
}.map do
4952
{
5053
icon: "triangle-exclamation",
5154
message: "#{_1[:entity_id].split(".").last.humanize} unavailable"

0 commit comments

Comments
 (0)