Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Deprecated supported features values #48

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

golles
Copy link
Contributor

@golles golles commented Jan 4, 2024

This should fix #47

I've tested my changes locally using: https://github.com/golles/Home-Assistant-Config/blob/main/packages/media_players/mediabox_homelkit.yaml

I've also set up a local dev container to apply the changes there and test from there

It would be good if more people could test it, as there are no automated tests.

I'll provide some inline comments on what I did.

Let me know your feedback

Comment on lines -5 to -11

import logging
from itertools import chain

from homeassistant.const import MATCH_ALL

_LOGGER = logging.getLogger(__name__)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file wasn't doing anything, so I've removed the content

Comment on lines +1 to +4
"""
Template for media-player
https://github.com/Sennevds/media_player.template
"""
Copy link
Contributor Author

@golles golles Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old description seemed to be copied from somewhere else, I assumed you would like the same description as in __init__.py

await self._mute_script.async_run(
{"is_muted": mute}, context=self._context
)
await self._mute_script.async_run({"is_muted": mute}, context=self._context)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier has formatted it like this

@@ -742,7 +721,7 @@ def sound_mode(self):
"""Return the current input source."""
try:
if self._current_sound_mode_template is not None:
self._curre = self._current_sound_mode_template.async_render()
self._sound_mode = self._current_sound_mode_template.async_render()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sennevds please double check this, it looked like something was broken here

@@ -150,14 +131,14 @@


async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the template binary sensors."""
"""Set up platform."""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better description


await async_setup_reload_service(hass, DOMAIN, PLATFORMS)
async_add_entities(await _async_create_entities(hass, config))


async def _async_create_entities(hass, config):
"""Set up the Template switch."""
"""Set up entities."""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better description

@@ -97,7 +79,6 @@
MEDIA_DURATION_TEMPLATE = "media_duration_template"
CURRENT_SOUND_MODE_TEMPLATE = "current_sound_mode_template"
CONF_SOUND_MODES = "sound_modes"
CONF_UNIQUE_ID = "unique_id"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecated supported features values - HA Core 2024.01.0b2 and above
2 participants