Skip to content

Commit

Permalink
Merge pull request #176 from GrandMoff100/remove-discovery-info
Browse files Browse the repository at this point in the history
Remove deprecated discovery info methods
  • Loading branch information
GrandMoff100 authored Mar 14, 2024
2 parents e275e64 + 5c220fa commit 86ce6bb
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
7 changes: 0 additions & 7 deletions homeassistant_api/rawasyncclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,6 @@ async def async_get_rendered_template(self, template: str) -> str:
"Try debugging it in the developer tools page of homeassistant."
) from err

@staticmethod
async def async_get_discovery_info() -> Dict[str, Any]:
"""Returns a dictionary of discovery info such as internal_url and version"""
raise DeprecationWarning(
"This endpoint has been removed from homeassistant. This function is to be removed in future release."
)

# API check methods
async def async_check_api_config(self) -> bool:
"""
Expand Down
7 changes: 0 additions & 7 deletions homeassistant_api/rawclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,6 @@ def get_rendered_template(self, template: str) -> str:
"Try debugging it in the developer tools page of homeassistant."
) from err

@staticmethod
def get_discovery_info() -> Dict[str, Any]:
"""Returns a dictionary of discovery info such as internal_url and version"""
raise DeprecationWarning(
"This endpoint has been removed from homeassistant. This function is to be removed in future release."
)

# API check methods
def check_api_config(self) -> bool:
"""
Expand Down
10 changes: 0 additions & 10 deletions tests/test_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,6 @@ async def test_async_invalid_template(async_cached_client: Client) -> None:
await async_cached_client.async_get_rendered_template("{{ invalid_template lol")


def test_discovery_info_deprecated(cached_client: Client) -> None:
with pytest.raises(DeprecationWarning):
cached_client.get_discovery_info()


async def test_async_discovery_info_deprecated(async_cached_client: Client) -> None:
with pytest.raises(DeprecationWarning):
await async_cached_client.async_get_discovery_info()


def test_prepare_entity_id(cached_client: Client) -> None:
"""Tests all cases for :py:meth:`Client.prepare_entity_id`."""
assert cached_client.prepare_entity_id(group_id="person", slug="me") == "person.me"
Expand Down

0 comments on commit 86ce6bb

Please sign in to comment.