-
Notifications
You must be signed in to change notification settings - Fork 22
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
Conversation
|
||
import logging | ||
from itertools import chain | ||
|
||
from homeassistant.const import MATCH_ALL | ||
|
||
_LOGGER = logging.getLogger(__name__) |
There was a problem hiding this comment.
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
""" | ||
Template for media-player | ||
https://github.com/Sennevds/media_player.template | ||
""" |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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.""" |
There was a problem hiding this comment.
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.""" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this and replaced it with an import (added line 29, see https://github.com/golles/media_player.template/blob/fix-for-%2347/custom_components/media_player_template/media_player.py#L29)
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