Skip to content

Commit 2ee00a1

Browse files
committed
Remove AlarmDisplay from this PR
1 parent bdc62e5 commit 2ee00a1

1 file changed

Lines changed: 0 additions & 17 deletions

File tree

  • common/src/main/kotlin/io/homeassistant/companion/android/common/data/integration/display

common/src/main/kotlin/io/homeassistant/companion/android/common/data/integration/display/EntityDisplayItem.kt

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import io.homeassistant.companion.android.common.data.integration.friendlyState
1010
import io.homeassistant.companion.android.common.data.integration.getIcon
1111
import io.homeassistant.companion.android.common.data.integration.isActive
1212
import io.homeassistant.companion.android.common.data.integration.isExecuting
13-
import io.homeassistant.companion.android.common.data.integration.supportsAlarmControlPanelArmAway
1413

1514
private const val CATEGORY_CONFIG = "config"
1615
private const val CATEGORY_DIAGNOSTIC = "diagnostic"
@@ -34,13 +33,6 @@ enum class EntityCategory {
3433
@Immutable
3534
data class EntityCoordinates(val latitude: Double, val longitude: Double)
3635

37-
/** Display information specific to `alarm_control_panel` entities. */
38-
@Immutable
39-
data class AlarmDisplay(
40-
/** Whether the alarm panel can be armed without entering a code. */
41-
val hasNoCode: Boolean,
42-
)
43-
4436
/**
4537
* Everything needed to display an entity, fully resolved from the entity state and the
4638
* registries: the single source of truth for entity displays, so anything a display needs
@@ -62,8 +54,6 @@ data class EntityDisplayItem(
6254
val isActive: Boolean = false,
6355
/** Geographic position of the entity, null when it has none. */
6456
val coordinates: EntityCoordinates? = null,
65-
/** Alarm panel display information, only set for `alarm_control_panel` entities. */
66-
val alarm: AlarmDisplay? = null,
6757
val areaName: String? = null,
6858
val floorName: String? = null,
6959
val deviceName: String? = null,
@@ -97,7 +87,6 @@ data class EntityDisplayItem(
9787
isExecuting = entity.isExecuting(),
9888
isActive = entity.isActive(),
9989
coordinates = entity.coordinates(),
100-
alarm = entity.alarmDisplay(),
10190
areaName = areaName,
10291
floorName = floorName,
10392
deviceName = deviceName,
@@ -118,12 +107,6 @@ data class EntityDisplayItem(
118107
?.joinToString(if (layoutDirection == LayoutDirection.Ltr) "" else "")
119108

120109
companion object {
121-
private fun Entity.alarmDisplay(): AlarmDisplay? {
122-
if (domain != "alarm_control_panel") return null
123-
return AlarmDisplay(
124-
hasNoCode = attributes["code_format"] == null && supportsAlarmControlPanelArmAway(),
125-
)
126-
}
127110

128111
private fun Entity.coordinates(): EntityCoordinates? {
129112
val latitude = (attributes["latitude"] as? Number)?.toDouble()

0 commit comments

Comments
 (0)