HASS.Agent-Integration
HASS.Agent-Integration copied to clipboard
Replace MEDIA_TYPE_MUSIC with MediaType.MUSIC
The constant MEDIA_TYPE_MUSIC (and possibly others in the same group) has been removed in recent Home Assistant versions. The HASS.Agent integration’s media_player.py file was still trying to import it from homeassistant.components.media_player.const, which caused an import error (ImportError: cannot import name 'MEDIA_TYPE_MUSIC').
What was done: Updated the imports and references to use the new enums introduced by Home Assistant. The code now imports from homeassistant.components.media_player import MediaType and uses MediaType.MUSIC instead of the deprecated MEDIA_TYPE_MUSIC constant.
Result: The integration now loads the media_player platform correctly again, restoring compatibility with the latest versions of Home Assistant.