How do I deflate content()?

ser <ser.avjbjb-NUepA2SMhDQqspMVqqL2D+4xXEVPTSb/[email protected]> Fri, 16 Dec 2022 16:43:08 +0000
Newsgroups gmane.music.equipment.slimdevices.devel
Organization Logitech Squeezebox Forums
Message-ID <[email protected]>
Preamble: I'm trying to update the github.com/hans99/squeeze-remote-hass
plugin to get it to work with current versions of Home Assistant, and
I'm requesting some hints to help me move forward. I'm not at all versed
in Perl, so many of my questions will be stupid. The plugin is supposed
to provide control of Home Assistant through the LMS interface; my
ultimate objective is to get this on a DUET for a fancy all-in-one
remote. Well, the real objective is to impress my wife, but you know.

After I got past the (relatively easy) update of the authentication
mechinasm, and stopped getting 40x responses, the logs started showing
JSON parsing errors. That's because the 
Code:
--------------------
    content()
--------------------
 is apparently compressed.

  
- The   
Code:
--------------------
        $response->headers->content_type
--------------------
     is application/json
- But it appears that the base adds "allow gzip" in all requests,
  because
-   
Code:
--------------------
        $response->headers->content_encoding
--------------------
     is   
Code:
--------------------
        deflate
--------------------
    
  

Digging around, I found a sub unzip in Base.pm, but this is where my
lack of Perl stops me; I tried calling unzip, but it throws 
Code:
--------------------
    Can't locate object method "header" via package
--------------------
, and now I know that my dart-throwing may not even be in the same room
as the dartboard.

Can someone suggest what I might do to either:

  
- disable compression on all requests in this plugin, since all actors
  are on the same computer, or
- decompress the content, which I assume I would have to do
  everywhere, or
- even better, tell me that there's a handy way of getting the content
  already uncompressed
  

If I get this plugin working, I'll submit a PR to the author but also
leave my repo up; the original plugin uses a custom domain -- I think
using Github CI to create the zip and host the plugin xml might be a
more robust long-term solution, but that's a job for future-Me. Now-Me
just wants to get the plugin working, and both I appreciate any
suggestions and appologize for my bone-headedness when it comes to Perl.
And the inner workings of LMS. And life, in general.


------------------------------------------------------------------------
ser's Profile: http://forums.slimdevices.com/member.php?userid=73240
View this thread: http://forums.slimdevices.com/showthread.php?t=117244