Skip to content

Commit

Permalink
Remove deprecated attributes from ping binary sensor (#125760)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbede authored Sep 11, 2024
1 parent 2db488b commit f6cf23a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
17 changes: 0 additions & 17 deletions homeassistant/components/ping/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

from __future__ import annotations

from typing import Any

from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
Expand All @@ -17,11 +15,6 @@
from .coordinator import PingUpdateCoordinator
from .entity import PingEntity

ATTR_ROUND_TRIP_TIME_AVG = "round_trip_time_avg"
ATTR_ROUND_TRIP_TIME_MAX = "round_trip_time_max"
ATTR_ROUND_TRIP_TIME_MDEV = "round_trip_time_mdev"
ATTR_ROUND_TRIP_TIME_MIN = "round_trip_time_min"


async def async_setup_entry(
hass: HomeAssistant, entry: PingConfigEntry, async_add_entities: AddEntitiesCallback
Expand Down Expand Up @@ -53,13 +46,3 @@ def __init__(
def is_on(self) -> bool:
"""Return true if the binary sensor is on."""
return self.coordinator.data.is_alive

@property
def extra_state_attributes(self) -> dict[str, Any] | None:
"""Return the state attributes of the ICMP checo request."""
return {
ATTR_ROUND_TRIP_TIME_AVG: self.coordinator.data.data.get("avg"),
ATTR_ROUND_TRIP_TIME_MAX: self.coordinator.data.data.get("max"),
ATTR_ROUND_TRIP_TIME_MDEV: self.coordinator.data.data.get("mdev"),
ATTR_ROUND_TRIP_TIME_MIN: self.coordinator.data.data.get("min"),
}
8 changes: 0 additions & 8 deletions tests/components/ping/snapshots/test_binary_sensor.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@
'attributes': ReadOnlyDict({
'device_class': 'connectivity',
'friendly_name': '10.10.10.10',
'round_trip_time_avg': 4.8,
'round_trip_time_max': 10,
'round_trip_time_mdev': None,
'round_trip_time_min': 1,
}),
'context': <ANY>,
'entity_id': 'binary_sensor.10_10_10_10',
Expand All @@ -54,10 +50,6 @@
'attributes': ReadOnlyDict({
'device_class': 'connectivity',
'friendly_name': '10.10.10.10',
'round_trip_time_avg': None,
'round_trip_time_max': None,
'round_trip_time_mdev': None,
'round_trip_time_min': None,
}),
'context': <ANY>,
'entity_id': 'binary_sensor.10_10_10_10',
Expand Down

0 comments on commit f6cf23a

Please sign in to comment.