hi,
I’m trying create AIMP integration with this:
- AIMP Media Player
- Control Plugin Code
- Alternative Web Interface for Control Plugin
using modified code from mphc and volumio component, but the code dont work
can someone point where i miss something,
def send_aimp_msg(self, method, params=None):
"""Send message."""
try:
data = {"version": "1.1", "method": method, "id": "1", "params": params}
requests.post(f"http://{self._url}/RPC_JSON", data=data, timeout=3)
except requests.exceptions.RequestException:
_LOGGER.error(
"Could not send command %s to AIMP at: %s", method, self._url
)
def update(self):
"""Update state."""
try:
playinfo = self.send_aimp_msg("GetPlaylistEntryInfo", params="{playlist_id: -1, track_id: -1}")
self._playinfo = playinfo.copy()
control = self.send_aimp_msg("SubscribeOnAIMPStateUpdateEvent", params="{event: \"control_panel_state_change\"}")
self._control = control.copy()
coverurl = self.send_aimp_msg("GetCover", params="{playlist_id: -1, track_id: -1, cover_width: 512, cover_height: 512}")
self._coverurl = coverurl.copy()
and here is the log
aimp: Error on device update!
Traceback (most recent call last):
File "/config/custom_components/aimp/media_player.py", line 109, in update
self._playinfo = playinfo.copy()
AttributeError: 'NoneType' object has no attribute 'copy'
[UPDATE]
You can download AIMP custom component for Home Assistant on link below:
AIMP custom component