elupus / arcam_fmj

Python module for interacting with a arcam fmj receiver
MIT License
8 stars 6 forks source link

Add SA10/20/30 series support #5

Closed evanugarte closed 3 years ago

evanugarte commented 3 years ago

Resolves #4

elupus commented 1 year ago

@evanugarte any chance you can have a look at: https://github.com/home-assistant/core/issues/84918

evanugarte commented 1 year ago

sure thing, i'll try to recreate the issue later today

On Sat, Dec 31, 2022 at 05:38 Joakim Plate @.***> wrote:

@evanugarte https://github.com/evanugarte any chance you can have a look at: home-assistant/core#84918 https://github.com/home-assistant/core/issues/84918

— Reply to this email directly, view it on GitHub https://github.com/elupus/arcam_fmj/pull/5#issuecomment-1368216926, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIVJL3OY5PS5E5MXH76F2PDWQAZOPANCNFSM5CRRVUJA . You are receiving this because you were mentioned.Message ID: @.***>

evanugarte commented 1 year ago

to fix, we will need to use a different enumerated type if the device is in the SA series.

in the spec for the Arcam sa10/20 (pdf), it has a different mapping of source to hex value on page 9. the arcam sa30 has the identical mapping on page 10 (pdf). in python the mappings become:

class SASeriesSourceCodes(IntOrTypeEnum):
    PHONO = 0x01
    AUX = 0x02
    PVR = 0x03
    AV = 0x04
    STB = 0x05
    CD = 0x06
    BD = 0x07
    SAT = 0x08
    GAME = 0x09
    NET = 0x0B
    USB = 0x0B
    ARC_ERC = 0x0D
    REQUEST_INPUT = 0xF0

what would be the best way to do this? the Client class would need to know what the type of Arcam device it is interacting with. perhaps passing in the device series to the constructor (defined in src/arcam/fmj/init.py:86)? then, if the series is SA, we can use this modified enum of source mappings.

elupus commented 1 year ago

I was pondering removing the value in the enum and maintaining a separate dict that maps byte values to enum values.

evanugarte commented 1 year ago

maybe we could pass in the ApiModel enum as an optional parameter, and if the model is APISA_SERIES we use the different mapping

elupus commented 1 year ago

Model is already known by the State class. It's checked on startup. So it's not that hard to remove the byte numbers from the Source and keep that as a separate map that is selected based on series.

evanugarte commented 1 year ago

Intend to work on this over the weekend

On Tue, Jan 3, 2023 at 3:19 PM Joakim Plate @.***> wrote:

Model is already known by the State class. It's checked on startup. So it's not that hard to remove the byte numbers from the Source and keep that as a separate map that is selected based on series.

— Reply to this email directly, view it on GitHub https://github.com/elupus/arcam_fmj/pull/5#issuecomment-1370323004, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIVJL3MOKTKHMO3ILRCCL5DWQSXZRANCNFSM5CRRVUJA . You are receiving this because you were mentioned.Message ID: @.***>

evanugarte commented 1 year ago

i plan to open a pr similar to #7, as the SA series supports non-rc5 commands to change source later today