NAME
Device::Osram::Lightify::Hub - Communicate with an Osram Lightify Hub
DESCRIPTION
This module allows basic operation of the Osram lightify bulbs, via connections to the Osram hub.
SYNOPSIS
use Device::Osram::Lightify;
my $tmp = Device::Osram::Lightify::Hub->new( host => "1.2.3.4" );
# Turn all devices on
$tmp->all_on();
# Turn all devices off
$tmp->all_of();
DESCRIPTION
This module will connect to an Osram Lightify hub, allowing the control of lights via Perl.
The communication with the hub is carried out by sending/receiving binary messages to the hub on port 4000. The specific bytes set have been documented in the Osram::Lightify::API module.
This module is responsible for:
- Identifying lights:
-
We can initiate a discovery of all the available lights, and create a suitable Osram::Lightify::Light object for each discovered light.
- Sending broadcast events:
-
We can send a broadcast event, which applies to all known lights, to instruct them to go on or off.
METHODS
new
Create a new hub-object, it is mandatory to provide a host
parameter which will give the IP (and optional port) of the Osram hub.
all_on
Broadcast an "on" event to all lights.
all_off
Broadcast an "off" event to all lights.
lights
Return a new Osram::Lightify::Light
object for each of the lights that could be discovered.
AUTHOR
Steve Kemp <steve@steve.org.uk>
COPYRIGHT AND LICENSE
Copyright (C) 2016 Steve Kemp <steve@steve.org.uk>.
This library is free software. You can modify and or distribute it under the same terms as Perl itself.