public static function lookupDevice($key, $value)
    {
        $devices = static::find();

        foreach ($devices as $device) {
            if ($value === $device[$key]) {
                return $device;
            }
        }

        return null;
    }
public static function lookupDevice($key, $value)
    {
        $devices = static::find();

        foreach ($devices as $device) {
            if ($value === $device[$key]) {
                return $device;
            }
        }

        return null;
    }
public static function lookupDevice ( $ key , $ value ) { $ devices = static :: find ( ) ; foreach ( $ devices as $ device ) { if ( $ value === $ device [ $ key ] ) { return $ device ; } } return null ; }
Lookup a device by key - value

@param $key   string
@param $value mixed

@return mixed
@throws \Exception
Lookup a device by key - value