From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

#!/usr/bin/perl
#
# Sample code to turn all devices on
#
# Usage:
#
# all_on --hub=192.168.10.11
#
# Steve
# --
#
use strict;
my %CONFIG;
# Default
$CONFIG{ 'hub' } = "192.168.10.136";
#
# Parse options
#
exit
unless ( Getopt::Long::GetOptions( "hub=s", \$CONFIG{ 'hub' }, ) );
#
# Create the object.
#
my $x = Device::Osram::Lightify::Hub->new( host => $CONFIG{ 'hub' } );
#
# All on.
#
$x->all_on();