MerossIot icon indicating copy to clipboard operation
MerossIot copied to clipboard

Application.MP3

Open sebirdman opened this issue 4 years ago • 2 comments

Hi!

I'm in the process of adding support for my "MP3" device which includes some sleep/lullaby tones for baby.

I've got a pretty good idea about how to add the command structure to change the volume. However, my biggest struggle is when determining the initial state of the device. Currently this library does:

        result = await self._execute_command(method="GET",
                                             namespace=Namespace.SYSTEM_ALL,
                                             payload={},
                                             skip_rate_limits=skip_rate_limits,
                                             drop_on_overquota=drop_on_overquota,
                                             timeout=timeout)

which of course, feels like it should get the WHOLE state for the device. This doesn't appear to be correct because the audio state isn't there. I have to do:

        result = await self._execute_command(method="GET",
                                             namespace=Namespace.CONTROL_MP3,
                                             payload={},
                                             skip_rate_limits=skip_rate_limits,
                                             drop_on_overquota=drop_on_overquota,
                                             timeout=timeout)

Any ideas on how i can avoid the extra call? Otherwise, it feels like as soon as the Namespace.CONTROL_MP3 feature is detected, we will have to make a separate call somehow.

Thanks so much for this library! The light part of my device "just worked" in home assistant.

sebirdman avatar Oct 21 '21 01:10 sebirdman

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 20 '21 02:12 stale[bot]

Hi @sebirdman , sorry for the late reply. In order to add an MP3 mixin, I need to gather more information about the device itself and the way it works.

To help me implement this feature in a dedicated mixin, I need you to:

  1. Provide the specific meross device name (i.e. mss310, mse425, etc);
  2. Provide the constant value of Namespace.CONTROL_MP3;
  3. Provide the result of the GET call to Namespace.CONTROL_MP3
  4. Provide an example of a PUSH notification received by the app when someone changes the tone on the device (you can use the meross sniffer for that)
  5. Provide an example (if supported) of a command to change tone on the device

I usually gather that info by myself when I do own a device to use; unfortunately I have no such device implementing the MP3 capability, so I cannot help on this one.

Let me know!

albertogeniola avatar Jan 02 '23 09:01 albertogeniola