Skip to content

Issues with stopping Spotify for A31 #113

@mitrokun

Description

@mitrokun

As already mentioned in the HA repository issue, there is a problem with the previous generation of chips.

I suggest the following solution. I was able to personally test Up2stream Pro/Mini and GGMM E2. I’m confident that the AMP series has the same issue.

    async def stop(self) -> None:
        """Stop the current playing track and remove the selected source."""
        manufacturer, _ = get_info_from_project(
            self.bridge.device.properties.get(DeviceAttribute.PROJECT, "")
        )
        current_mode_str = str(self.play_mode)
        special_stop_handler_manufacturers = ["Arylic", "GGMM"]

        if current_mode_str == '31' and manufacturer in special_stop_handler_manufacturers:
            LOGGER.debug(
                "%s on Spotify (mode 31) detected. Applying special stop sequence.",
                manufacturer
            )
            await self.pause()
            await self.set_play_mode(PlayingMode.NETWORK)

        await self.bridge.request(LinkPlayCommand.STOP)
        self.properties[PlayerAttribute.PLAYING_STATUS] = PlayingStatus.STOPPED

I think this might be excessive for Up2Stream HD DAC and ready-made S-series devices built on new SoCs. But this needs to be tested separately. If so, the dictionary-building logic will need to be revised.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions