Skip to content

Commit

Permalink
v0.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
onlyoneme committed Jun 29, 2023
1 parent 28daf31 commit 31c14ae
Show file tree
Hide file tree
Showing 7 changed files with 324 additions and 148 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# WiiM Mini devices
# WiiM devices

This component allows you to integrate control of WiiM Mini devices into your [Home Assistant](http://www.home-assistant.io) smart home system. Originally developed for LinkPlay devices by @nicjo814, @limych and @nagyrobi.
This component allows you to integrate control of WiiM Mini and Pro devices into your [Home Assistant](http://www.home-assistant.io) smart home system. Originally developed for LinkPlay devices by @nicjo814, @limych and @nagyrobi.


## Installation
Expand Down
10 changes: 6 additions & 4 deletions custom_components/wiim_custom/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Support for WiiM Mini devices.
Support for WiiM devices.
For more details about this platform, please refer to the documentation at
https://github.com/onlyoneme/home-assistant-custom-components-wiim
Expand All @@ -8,6 +8,7 @@
import voluptuous as vol

from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.components.media_player.const import MEDIA_TYPE_URL
from homeassistant.helpers import config_validation as cv

DOMAIN = 'wiim_custom'
Expand All @@ -25,7 +26,7 @@


CMND_SERVICE_SCHEMA = vol.Schema({
vol.Required(ATTR_ENTITY_ID): cv.entity_id,
vol.Required(ATTR_ENTITY_ID): cv.comp_entity_ids,
vol.Required(ATTR_CMD): cv.string,
vol.Optional(ATTR_NOTIF, default=True): cv.boolean
})
Expand All @@ -36,10 +37,11 @@
})

PRESET_BUTTON_SCHEMA = vol.Schema({
vol.Required(ATTR_ENTITY_ID): cv.entity_id,
vol.Required(ATTR_ENTITY_ID): cv.comp_entity_ids,
vol.Required(ATTR_PRESET): cv.positive_int
})


_LOGGER = logging.getLogger(__name__)

def setup(hass, config):
Expand Down Expand Up @@ -69,7 +71,7 @@ async def async_service_handle(service):
for device in entities:
if device.entity_id in entity_ids:
_LOGGER.debug("**PLAY URL** entity: %s; url: %s", device.entity_id, url)
await device.call_wiim_httpapi("setPlayerCmd:play:{0}".format(url), None)
await device.async_play_media(MEDIA_TYPE_URL, url)
elif service.service == SERVICE_PRESET:
preset = service.data.get(ATTR_PRESET)
for device in entities:
Expand Down
7 changes: 4 additions & 3 deletions custom_components/wiim_custom/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "wiim_custom",
"name": "WiiM",
"version":"0.2.3",
"version":"0.3.6-beta",
"documentation": "https://github.com/onlyoneme/home-assistant-custom-components-wiim",
"issue_tracker": "https://github.com/onlyoneme/home-assistant-custom-components-wiim/issues",
"after_dependencies": ["http", "media_source"],
Expand All @@ -11,10 +11,11 @@
"@nicjo814",
"@limych",
"@nagyrobi",
"@onlyoneme"
"@onlyoneme"
],
"requirements": [
"async-upnp-client>=0.31.2",
"validators~=0.12"
"validators~=0.12",
"lxml"
]
}
Loading

0 comments on commit 31c14ae

Please sign in to comment.