type:light-bulb - Light bulbs

The type light-bulb is a marker used to mark lights that are of the bulb type.

if(thing.matches('cap:light-bulb')) {
        // The thing is a light bulb
}

Implementing capability

Light bulbs are an extension to lights and need to follow the same implementation guidelines.

const { LightBulb, SwitchablePower } = require('abstract-things/lights');

class Example extends LightBulb.with(SwitchablePower) {

        changePower(power) {
                return changePowerOfLight(power);
        }

}