Skip Menu |

This queue is for tickets about the AHA CPAN distribution.

Report information
The Basics
Id: 94480
Status: open
Priority: 0/
Queue: AHA

People
Owner: Nobody in particular
Requestors: marcus.info [...] riseup.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: $aha->list() problem
Date: Sun, 06 Apr 2014 17:43:09 +0200
To: bug-AHA [...] rt.cpan.org
From: Marcus <marcus.info [...] riseup.net>
Hello, I have a problem to get the switches from the Fritz Box. I wanted to connect to my Fritzbox and read out the switch information ######################### #!/usr/bin/perl use AHA; use feature qw(say); $aha = new AHA("fritz.box","s!cr!t") # everything looks ok; I see the connection in the fritzbox syslog !! # Get all switches as array ref of AHA::Switch objects my $switches = $aha->list(); # nothing happens; seems that the script hangs!!! # For all switches found for my $switch (@$switches) { say "Name: ",$switch->name(); say "State: ",$switch->is_on(); say "Present: ",$switch->is_present(); say "Energy: ",$switch->energy(); say "Power: ",$switch->power(); } ############### System information: perl version: perl 5, version 14, subversion 2 (v5.14.2) os system: Linux mobile 3.11.0-15-generic #25-Ubuntu SMP Thu Jan 30 17:25:07 UTC 2014 i686 i686 i686 GNU/Linux AHA version: 'AHA' version '0.54' FritzBox: 7490 Fritz!OS: 06.05 I hope you can help me with this problem Best regards Marcus
The split in line 156 of AHA.pm is broken, maybe AVM changed the format?! The server returns a comma-separated list of AINs like "123,234,345". Change return [ map { new AHA::Switch($self,$_) } (split /\*,\*/,$self->_execute_cmd("getswitchlist")) ]; to return [ map { new AHA::Switch($self,$_) } (split /,/,$self->_execute_cmd("getswitchlist")) ]; and it works with 7490@6.05
Yes, you are absolutely right. Unfortunately I have only 1 switch to test, so that this bug never occured to me. In fact, it should have been /\s*,\s*/ in order to strip any spaces. (And yes, there are not 'much' tests since I really did it to suite my needs.

Will release a fix today.

Thanks for pointing this out ....
Just uploaded 0.55 with the appropriate fix. Should be available at the CPAN mirrors soon.